From c14cc4a1c8a41cb20e0f67339377fbdd7844a104 Mon Sep 17 00:00:00 2001 From: Braelyn Boynton Date: Mon, 1 Jul 2024 13:38:04 -0700 Subject: [PATCH] merge main --- examples/openai-gpt.ipynb | 70 +++++++-------------------------------- 1 file changed, 12 insertions(+), 58 deletions(-) diff --git a/examples/openai-gpt.ipynb b/examples/openai-gpt.ipynb index 20c9deee..a1a86650 100644 --- a/examples/openai-gpt.ipynb +++ b/examples/openai-gpt.ipynb @@ -13,14 +13,10 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "c51dcbda80eb8c53", "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-06-28T00:30:03.825152Z", - "start_time": "2024-06-28T00:30:02.908978Z" - } + "collapsed": false }, "outputs": [], "source": [ @@ -42,14 +38,10 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "cbc5d13679e269dc", "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-06-28T00:30:03.833846Z", - "start_time": "2024-06-28T00:30:03.826673Z" - } + "collapsed": false }, "outputs": [], "source": [ @@ -179,25 +171,12 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "b45754a57148eed1", "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-06-28T00:30:06.891420Z", - "start_time": "2024-06-28T00:30:06.878086Z" - } + "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": "6" - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "from agentops import record_function\n", "\n", @@ -220,14 +199,9 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "2ac84c35", - "metadata": { - "ExecuteTime": { - "end_time": "2024-06-28T00:30:07.509006Z", - "start_time": "2024-06-28T00:30:06.891103Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "from agentops import ActionEvent\n", @@ -249,35 +223,15 @@ }, { "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "🖇 AgentOps: This run's cost $0.000017\n", - "🖇 AgentOps: \u001B[34m\u001B[34mSession Replay: https://app.agentops.ai/drilldown?session_id=128cc6ae-3bd3-405f-865d-6fbc0b34f4b9\u001B[0m\u001B[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[{'event_type': 'actions', 'params': {'x': 2, 'y': 4}, 'returns': 6, 'init_timestamp': '2024-06-28T00:30:06.877Z', 'end_timestamp': '2024-06-28T00:30:06.883Z', 'agent_id': None, 'id': UUID('80bbb402-84fb-4ebf-a1b7-181109f356ea'), 'action_type': 'add numbers', 'logs': None, 'screenshot': None}, {'event_type': 'llms', 'params': {'model': 'gpt-3.5-turbo', 'messages': ({'role': 'user', 'content': 'Hello'},), 'temperature': 0.5}, 'returns': {'id': 'chatcmpl-9etn5beqXFWcKcYjN7cz8KfjV9nkr', 'choices': [{'finish_reason': 'stop', 'index': 0, 'logprobs': None, 'message': {'content': 'Hello! How can I assist you today?', 'role': 'assistant', 'function_call': None, 'tool_calls': None}}], 'created': 1719534607, 'model': 'gpt-3.5-turbo-0125', 'object': 'chat.completion', 'system_fingerprint': None, 'usage': {'completion_tokens': 9, 'prompt_tokens': 8, 'total_tokens': 17}}, 'init_timestamp': '2024-06-28T00:30:06.887Z', 'end_timestamp': '2024-06-28T00:30:07.500Z', 'agent_id': None, 'id': UUID('a9cd45d7-02cf-4998-8930-d22614a617e6'), 'thread_id': None, 'prompt': ({'role': 'user', 'content': 'Hello'},), 'prompt_tokens': 8, 'completion': {'content': 'Hello! How can I assist you today?', 'role': 'assistant', 'function_call': None, 'tool_calls': None}, 'completion_tokens': 9, 'model': 'gpt-3.5-turbo-0125'}, {'event_type': 'actions', 'params': \"({'role': 'user', 'content': 'Hello'},)\", 'returns': 'Hello! How can I assist you today?', 'init_timestamp': '2024-06-28T00:30:07.500Z', 'end_timestamp': '2024-06-28T00:30:07.506Z', 'agent_id': None, 'id': UUID('64ea5e0e-10ed-4907-9520-ac7fe5ad8e4e'), 'action_type': 'Agent says hello', 'logs': None, 'screenshot': None}]\n" - ] - } - ], + "outputs": [], "source": [ "agentops.end_session(\"Success\")" ], "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-06-28T00:30:08.615332Z", - "start_time": "2024-06-28T00:30:07.509346Z" - } + "collapsed": false }, "id": "4ca2b49fc06adddb", - "execution_count": 9 + "execution_count": null } ], "metadata": {