Skip to content

Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI

Notebooks in docs (#318)

Braelyn Boyntonc6892e83aade
diff --git a/.github/workflows/notebook-gen.yml b/.github/workflows/notebook-gen.yml
new file mode 100644
index 00000000..54d00c34
--- /dev/null
+++ b/.github/workflows/notebook-gen.yml
@@ -0,0 +1,36 @@
+name: Check Generated Files
+
+on: push
+
+jobs:
+ check-diff:
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Setup Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.11'
+
+ - name: Install Dependencies
+ if: always()
+ run: |
+ python -m pip install --upgrade pip
+ # Install your project dependencies here if necessary
+
+ - name: Run generate script
+ if: always()
+ run: python docs/v1/examples/notebooks/generate.py
+
+ - name: Check for differences
+ if: always()
+ run: |
+ if [[ `git status --porcelain` ]]; then
+ echo "Notebooks have been changed without being regenerated. Please run `python docs/v1/examples/notebooks/generate.py`."
+ exit 1
+ else
+ echo "No changes were detected. Notebooks up to date 💅🏻"
+ fi
\ No newline at end of file
diff --git a/docs/mint.json b/docs/mint.json
index 097821c2..152c9c96 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -61,7 +61,7 @@
"group": "Getting Started",
"pages": [
"v1/quickstart",
- "v1/examples"
+ "v1/examples/examples"
]
},
{
diff --git a/docs/v1/examples.mdx b/docs/v1/examples/examples.mdx
similarity index 87%
rename from docs/v1/examples.mdx
rename to docs/v1/examples/examples.mdx
index 8d1775f1..d57975be 100644
--- a/docs/v1/examples.mdx
+++ b/docs/v1/examples/examples.mdx
@@ -16,16 +16,19 @@ mode: "wide"
<Card title="AutoGen" icon="microsoft" href="/v1/integrations/autogen">
AutoGen multi-agent conversible workflow with tool usage
</Card>
- <Card title="Multi-Agent Code Example" icon="people-arrows" iconType="duotone" href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/multi_agent_example.ipynb">
+ <Card title="Multi-Agent Code Example" icon="people-arrows" iconType="duotone" href="/v1/examples/multi_agent">
Jupyter Notebook with a simple multi-agent design
</Card>
- <Card title="LangChain Example" icon="crow" href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/langchain_examples.ipynb">
+ <Card title="LangChain Example" icon="crow" href="/v1/examples/langchain">
Jupyter Notebook with a sample LangChain integration
</Card>
<Card title="FastAPI Example" icon="bolt-lightning" href="/v1/examples/fastapi">
Create a REST server that performs and observes agent tasks
</Card>
- <Card title="MultiOn Example" icon="atom" href="https://github.com/AgentOps-AI/agentops/blob/main/examples/multion/Autonomous_web_browsing.ipynb">
+ <Card title="Multi Session Example" icon="computer" href="/v1/examples/multi_session">
+ Manage multiple sessions at the same time
+ </Card>
+ <Card title="MultiOn Example" icon="atom" href="/v1/examples/multion">
Create an autonomous browser agent capable of navigating the web and extracting information
</Card>
</CardGroup>
diff --git a/docs/v1/examples/langchain.mdx b/docs/v1/examples/langchain.mdx
new file mode 100644
index 00000000..68598c94
--- /dev/null
+++ b/docs/v1/examples/langchain.mdx
@@ -0,0 +1,10 @@
+---
+title: 'Langchain Example'
+description: 'Using the Langchain Callback Handler'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/48ae12d4e4e085eed57346f1c40a054097431937/examples/langchain_examples.ipynb'} target={'_blank'}>Github</a>_
+
+<iframe id="iframe" src={'notebooks/langchain_examples.html'}></iframe>
+
+<script type="module" src="/scripts/full_iframe.js"></script>
diff --git a/docs/v1/examples/multi_agent.mdx b/docs/v1/examples/multi_agent.mdx
new file mode 100644
index 00000000..40db7cbf
--- /dev/null
+++ b/docs/v1/examples/multi_agent.mdx
@@ -0,0 +1,10 @@
+---
+title: 'Multi-Agent Example'
+description: 'How to track events from multiple different agents'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/main/examples/multi_agent_example.ipynb'} target={'_blank'}>Github</a>_
+
+<iframe id="iframe" src={'notebooks/multi_agent_example.html'}></iframe>
+
+<script type="module" src="/scripts/full_iframe.js"></script>
diff --git a/docs/v1/examples/multi_session.mdx b/docs/v1/examples/multi_session.mdx
new file mode 100644
index 00000000..2742fc93
--- /dev/null
+++ b/docs/v1/examples/multi_session.mdx
@@ -0,0 +1,10 @@
+---
+title: 'Multi-Session Example'
+description: 'Handling multiple sessions at the same time'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/48ae12d4e4e085eed57346f1c40a054097431937/examples/multi_session_llm.ipynb'} target={'_blank'}>Github</a>_
+
+<iframe id="iframe" src={'notebooks/multi_session_llm.html'}></iframe>
+
+<script type="module" src="/scripts/full_iframe.js"></script>
diff --git a/docs/v1/examples/multion.mdx b/docs/v1/examples/multion.mdx
new file mode 100644
index 00000000..c506b895
--- /dev/null
+++ b/docs/v1/examples/multion.mdx
@@ -0,0 +1,12 @@
+---
+title: 'Multion Examples'
+description: 'Tracking Multion usage with AgentOps'
+mode: "wide"
+---
+
+<iframe id="iframe" src={'notebooks/multion/Autonomous_web_browsing.html'}></iframe>
+<iframe id="iframe" src={'notebooks/multion/Sample_browsing_agent.html'}></iframe>
+<iframe id="iframe" src={'notebooks/multion/Step_by_step_web_browsing.html'}></iframe>
+<iframe id="iframe" src={'notebooks/multion/Webpage_data_retrieval.html'}></iframe>
+
+<script type="module" src="/scripts/full_iframe.js"></script>
diff --git a/docs/v1/examples/notebooks/README.md b/docs/v1/examples/notebooks/README.md
new file mode 100644
index 00000000..4501045f
--- /dev/null
+++ b/docs/v1/examples/notebooks/README.md
@@ -0,0 +1,8 @@
+# Generate Notebooks in Docs
+
+1. `brew install pandoc`
+2. `python generate.py`
+
+This generates HTML versions of the notebooks.
+
+Make sure there is a corresponding
\ No newline at end of file
diff --git a/docs/v1/examples/notebooks/autogen/AgentChat.html b/docs/v1/examples/notebooks/autogen/AgentChat.html
new file mode 100644
index 00000000..0767c34d
--- /dev/null
+++ b/docs/v1/examples/notebooks/autogen/AgentChat.html
@@ -0,0 +1,230 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>AgentChat</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div id="bb6538d8-2a5d-4a99-b2c1-7130963e4f7b" class="cell markdown">
+<h1 id="adding-agentops-to-an-existing-autogen-service">Adding AgentOps
+to an existing Autogen service</h1>
+<p><img src="https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen_integration.png?raw=true"/></p>
+<p>To get started, you'll need to install the AgentOps package and <a
+href="app.agentops.ai">set an API key</a>.</p>
+<p>AgentOps automatically configures itself when it's initialized
+meaning your agent run data will be tracked and logged to your AgentOps
+account right away.</p>
+</div>
+<div id="d93f2339-7b99-4cf1-9232-c24faba49c7b" class="cell code"
+data-execution_count="1">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> autogen <span class="im">import</span> ConversableAgent, UserProxyAgent</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="co"># When initializing AgentOps, you can pass in optional tags to help filter sessions</span></span>
+<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a>agentops.init(api_key<span class="op">=</span><span class="st">&quot;...&quot;</span>, tags<span class="op">=</span>[<span class="st">&quot;simple-autogen-example&quot;</span>])</span>
+<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;AgentOps is now running. You can view your session in the link above&quot;</span>)</span></code></pre></div>
+<div class="output stream stderr">
+<pre><code>🖇 AgentOps: Session Replay: https://app.agentops.ai/drilldown?session_id=24c5d9f6-fb82-41e6-a468-2dc74a5318a3
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>AgentOps is now running. You can view your session in the link above
+</code></pre>
+</div>
+</div>
+<div id="7858f0f6-9aca-4cdb-a514-9fbf7e353d50" class="cell markdown">
+<p>AutoGen will now start automatically tracking</p>
+<ul>
+<li>LLM prompts and completions</li>
+<li>Token usage and costs</li>
+<li>Agent names and actions</li>
+<li>Correspondence between agents</li>
+<li>Tool usage</li>
+<li>Errors</li>
+</ul>
+</div>
+<div id="2962d990-f7ef-43d8-ba09-d29bd8356d9f" class="cell code"
+data-execution_count="2">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Define an openai api key for the agent configurations</span></span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>openai_api_key <span class="op">=</span> <span class="st">&quot;...&quot;</span></span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>config_list <span class="op">=</span> [</span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> {<span class="st">&quot;model&quot;</span>: <span class="st">&quot;gpt-4-turbo&quot;</span>, <span class="st">&quot;api_key&quot;</span>: openai_api_key, <span class="st">&quot;tags&quot;</span>: [<span class="st">&quot;gpt-4&quot;</span>, <span class="st">&quot;tool&quot;</span>]}</span>
+<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a>]</span>
+<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="co"># Create the agent that uses the LLM.</span></span>
+<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a>assistant <span class="op">=</span> ConversableAgent(<span class="st">&quot;agent&quot;</span>, llm_config<span class="op">=</span>{<span class="st">&quot;config_list&quot;</span>: config_list})</span>
+<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a><span class="co"># Create the agent that represents the user in the conversation.</span></span>
+<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a>user_proxy <span class="op">=</span> UserProxyAgent(<span class="st">&quot;user&quot;</span>, code_execution_config<span class="op">=</span><span class="va">False</span>)</span>
+<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a><span class="co"># Let the assistant start the conversation. It will end when the user types &quot;exit&quot;.</span></span>
+<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a>assistant.initiate_chat(user_proxy, message<span class="op">=</span><span class="st">&quot;How can I help you today?&quot;</span>)</span>
+<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a><span class="co"># Close your AgentOps session to indicate that it completed.</span></span>
+<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span>
+<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;Success! Visit your AgentOps dashboard to see the replay&quot;</span>)</span></code></pre></div>
+<div class="output stream stdout">
+<pre><code>agent (to user):
+
+How can I help you today?
+
+--------------------------------------------------------------------------------
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>Provide feedback to agent. Press enter to skip and use auto-reply, or type &#39;exit&#39; to end the conversation: Tell me a joke about AgentOps
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>user (to agent):
+
+Tell me a joke about AgentOps
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; USING AUTO REPLY...
+agent (to user):
+
+Why don&#39;t AgentOps teams ever play hide and seek?
+
+Because good luck hiding when they always know where everyone is supposed to be!
+
+--------------------------------------------------------------------------------
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>Provide feedback to agent. Press enter to skip and use auto-reply, or type &#39;exit&#39; to end the conversation: Another
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>user (to agent):
+
+Another
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; USING AUTO REPLY...
+agent (to user):
+
+Why did the AgentOps team bring a ladder to work?
+
+Because they’re always reaching for high-level optimizations!
+
+--------------------------------------------------------------------------------
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>Provide feedback to agent. Press enter to skip and use auto-reply, or type &#39;exit&#39; to end the conversation: exit
+</code></pre>
+</div>
+<div class="output stream stderr">
+<pre><code>🖇 AgentOps: This run&#39;s cost $0.001080
+🖇 AgentOps: Session Replay: https://app.agentops.ai/drilldown?session_id=24c5d9f6-fb82-41e6-a468-2dc74a5318a3
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>Success! Visit your AgentOps dashboard to see the replay
+</code></pre>
+</div>
+</div>
+<div id="7b422137-903a-41ef-a4ca-95b50aea4138" class="cell markdown">
+<p>You can view data on this run at <a
+href="app.agentops.ai">app.agentops.ai</a>.</p>
+<p>The dashboard will display LLM events for each message sent by each
+agent, including those made by the human user.</p>
+</div>
+<div id="72993a75-1031-4874-aa26-0ef816a3256c" class="cell code">
+<div class="sourceCode" id="cb13"><pre
+class="sourceCode python"><code class="sourceCode python"></code></pre></div>
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/autogen/MathAgent.html b/docs/v1/examples/notebooks/autogen/MathAgent.html
new file mode 100644
index 00000000..37caae7f
--- /dev/null
+++ b/docs/v1/examples/notebooks/autogen/MathAgent.html
@@ -0,0 +1,339 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>MathAgent</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div id="bb6538d8-2a5d-4a99-b2c1-7130963e4f7b" class="cell markdown">
+<h1 id="adding-agentops-to-an-existing-autogen-service">Adding AgentOps
+to an existing Autogen service</h1>
+<p><img src="https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen_integration.png?raw=true"/></p>
+<p>To get started, you'll need to install the AgentOps package and <a
+href="app.agentops.ai">set an API key</a>.</p>
+<p>AgentOps automatically configures itself when it's initialized
+meaning your agent run data will be tracked and logged to your AgentOps
+account right away.</p>
+</div>
+<div id="d93f2339-7b99-4cf1-9232-c24faba49c7b" class="cell code"
+data-execution_count="1">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> typing <span class="im">import</span> Annotated, Literal</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> autogen <span class="im">import</span> ConversableAgent, register_function</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a>agentops.init(api_key<span class="op">=</span><span class="st">&quot;...&quot;</span>, tags<span class="op">=</span>[<span class="st">&quot;autogen-tool-example&quot;</span>])</span>
+<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;AgentOps is now running. You can view your session in the link above&quot;</span>)</span></code></pre></div>
+<div class="output stream stderr">
+<pre><code>🖇 AgentOps: Session Replay: https://app.agentops.ai/drilldown?session_id=51556b00-428b-4cae-b815-1320ebc7e810
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>AgentOps is now running. You can view your session in the link above
+</code></pre>
+</div>
+</div>
+<div id="7858f0f6-9aca-4cdb-a514-9fbf7e353d50" class="cell markdown">
+<p>AutoGen will now start automatically tracking</p>
+<ul>
+<li>LLM prompts and completions</li>
+<li>Token usage and costs</li>
+<li>Agent names and actions</li>
+<li>Correspondence between agents</li>
+<li>Tool usage</li>
+<li>Errors</li>
+</ul>
+</div>
+<div id="2962d990-f7ef-43d8-ba09-d29bd8356d9f" class="cell code"
+data-execution_count="2">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Define an openai api key for the agent configurations</span></span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>openai_api_key <span class="op">=</span> <span class="st">&quot;...&quot;</span></span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>config_list <span class="op">=</span> [</span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> {<span class="st">&quot;model&quot;</span>: <span class="st">&quot;gpt-4-turbo&quot;</span>, <span class="st">&quot;api_key&quot;</span>: openai_api_key, <span class="st">&quot;tags&quot;</span>: [<span class="st">&quot;gpt-4&quot;</span>, <span class="st">&quot;tool&quot;</span>]}</span>
+<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a>]</span></code></pre></div>
+</div>
+<div id="9e4dfe37-85e0-4035-a314-3459c6e378c4" class="cell code"
+data-execution_count="3">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>Operator <span class="op">=</span> Literal[<span class="st">&quot;+&quot;</span>, <span class="st">&quot;-&quot;</span>, <span class="st">&quot;*&quot;</span>, <span class="st">&quot;/&quot;</span>]</span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> calculator(a: <span class="bu">int</span>, b: <span class="bu">int</span>, operator: Annotated[Operator, <span class="st">&quot;operator&quot;</span>]) <span class="op">-&gt;</span> <span class="bu">int</span>:</span>
+<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> operator <span class="op">==</span> <span class="st">&quot;+&quot;</span>:</span>
+<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> a <span class="op">+</span> b</span>
+<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">elif</span> operator <span class="op">==</span> <span class="st">&quot;-&quot;</span>:</span>
+<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> a <span class="op">-</span> b</span>
+<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">elif</span> operator <span class="op">==</span> <span class="st">&quot;*&quot;</span>:</span>
+<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> a <span class="op">*</span> b</span>
+<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">elif</span> operator <span class="op">==</span> <span class="st">&quot;/&quot;</span>:</span>
+<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="bu">int</span>(a <span class="op">/</span> b)</span>
+<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span>:</span>
+<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a> <span class="cf">raise</span> <span class="pp">ValueError</span>(<span class="st">&quot;Invalid operator&quot;</span>)</span>
+<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a><span class="co"># Create the agent that uses the LLM.</span></span>
+<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a>assistant <span class="op">=</span> ConversableAgent(</span>
+<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a> name<span class="op">=</span><span class="st">&quot;Assistant&quot;</span>,</span>
+<span id="cb5-20"><a href="#cb5-20" aria-hidden="true" tabindex="-1"></a> system_message<span class="op">=</span><span class="st">&quot;You are a helpful AI assistant. &quot;</span></span>
+<span id="cb5-21"><a href="#cb5-21" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;You can help with simple calculations. &quot;</span></span>
+<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;Return &#39;TERMINATE&#39; when the task is done.&quot;</span>,</span>
+<span id="cb5-23"><a href="#cb5-23" aria-hidden="true" tabindex="-1"></a> llm_config<span class="op">=</span>{<span class="st">&quot;config_list&quot;</span>: config_list},</span>
+<span id="cb5-24"><a href="#cb5-24" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-25"><a href="#cb5-25" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-26"><a href="#cb5-26" aria-hidden="true" tabindex="-1"></a><span class="co"># The user proxy agent is used for interacting with the assistant agent</span></span>
+<span id="cb5-27"><a href="#cb5-27" aria-hidden="true" tabindex="-1"></a><span class="co"># and executes tool calls.</span></span>
+<span id="cb5-28"><a href="#cb5-28" aria-hidden="true" tabindex="-1"></a>user_proxy <span class="op">=</span> ConversableAgent(</span>
+<span id="cb5-29"><a href="#cb5-29" aria-hidden="true" tabindex="-1"></a> name<span class="op">=</span><span class="st">&quot;User&quot;</span>,</span>
+<span id="cb5-30"><a href="#cb5-30" aria-hidden="true" tabindex="-1"></a> llm_config<span class="op">=</span><span class="va">False</span>,</span>
+<span id="cb5-31"><a href="#cb5-31" aria-hidden="true" tabindex="-1"></a> is_termination_msg<span class="op">=</span><span class="kw">lambda</span> msg: msg.get(<span class="st">&quot;content&quot;</span>) <span class="kw">is</span> <span class="kw">not</span> <span class="va">None</span></span>
+<span id="cb5-32"><a href="#cb5-32" aria-hidden="true" tabindex="-1"></a> <span class="kw">and</span> <span class="st">&quot;TERMINATE&quot;</span> <span class="kw">in</span> msg[<span class="st">&quot;content&quot;</span>],</span>
+<span id="cb5-33"><a href="#cb5-33" aria-hidden="true" tabindex="-1"></a> human_input_mode<span class="op">=</span><span class="st">&quot;NEVER&quot;</span>,</span>
+<span id="cb5-34"><a href="#cb5-34" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-35"><a href="#cb5-35" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-36"><a href="#cb5-36" aria-hidden="true" tabindex="-1"></a>assistant.register_for_llm(name<span class="op">=</span><span class="st">&quot;calculator&quot;</span>, description<span class="op">=</span><span class="st">&quot;A simple calculator&quot;</span>)(</span>
+<span id="cb5-37"><a href="#cb5-37" aria-hidden="true" tabindex="-1"></a> calculator</span>
+<span id="cb5-38"><a href="#cb5-38" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-39"><a href="#cb5-39" aria-hidden="true" tabindex="-1"></a>user_proxy.register_for_execution(name<span class="op">=</span><span class="st">&quot;calculator&quot;</span>)(calculator)</span>
+<span id="cb5-40"><a href="#cb5-40" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-41"><a href="#cb5-41" aria-hidden="true" tabindex="-1"></a><span class="co"># Register the calculator function to the two agents.</span></span>
+<span id="cb5-42"><a href="#cb5-42" aria-hidden="true" tabindex="-1"></a>register_function(</span>
+<span id="cb5-43"><a href="#cb5-43" aria-hidden="true" tabindex="-1"></a> calculator,</span>
+<span id="cb5-44"><a href="#cb5-44" aria-hidden="true" tabindex="-1"></a> caller<span class="op">=</span>assistant, <span class="co"># The assistant agent can suggest calls to the calculator.</span></span>
+<span id="cb5-45"><a href="#cb5-45" aria-hidden="true" tabindex="-1"></a> executor<span class="op">=</span>user_proxy, <span class="co"># The user proxy agent can execute the calculator calls.</span></span>
+<span id="cb5-46"><a href="#cb5-46" aria-hidden="true" tabindex="-1"></a> name<span class="op">=</span><span class="st">&quot;calculator&quot;</span>, <span class="co"># By default, the function name is used as the tool name.</span></span>
+<span id="cb5-47"><a href="#cb5-47" aria-hidden="true" tabindex="-1"></a> description<span class="op">=</span><span class="st">&quot;A simple calculator&quot;</span>, <span class="co"># A description of the tool.</span></span>
+<span id="cb5-48"><a href="#cb5-48" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-49"><a href="#cb5-49" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-50"><a href="#cb5-50" aria-hidden="true" tabindex="-1"></a><span class="co"># Let the assistant start the conversation. It will end when the user types &quot;exit&quot;.</span></span>
+<span id="cb5-51"><a href="#cb5-51" aria-hidden="true" tabindex="-1"></a>user_proxy.initiate_chat(assistant, message<span class="op">=</span><span class="st">&quot;What is (1423 - 123) / 3 + (32 + 23) * 5?&quot;</span>)</span>
+<span id="cb5-52"><a href="#cb5-52" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-53"><a href="#cb5-53" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+<div class="output stream stderr">
+<pre><code>🖇 AgentOps: Cannot start session - session already started
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>User (to Assistant):
+
+What is (1423 - 123) / 3 + (32 + 23) * 5?
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; USING AUTO REPLY...
+</code></pre>
+</div>
+<div class="output stream stderr">
+<pre><code>/Users/reibs/Projects/autogen/autogen/agentchat/conversable_agent.py:2489: UserWarning: Function &#39;calculator&#39; is being overridden.
+ warnings.warn(f&quot;Function &#39;{tool_sig[&#39;function&#39;][&#39;name&#39;]}&#39; is being overridden.&quot;, UserWarning)
+/Users/reibs/Projects/autogen/autogen/agentchat/conversable_agent.py:2408: UserWarning: Function &#39;calculator&#39; is being overridden.
+ warnings.warn(f&quot;Function &#39;{name}&#39; is being overridden.&quot;, UserWarning)
+</code></pre>
+</div>
+<div class="output stream stdout">
+<pre><code>Assistant (to User):
+
+***** Suggested tool call (call_pSJXJKu1qbfRV4SVNHzTaG1z): calculator *****
+Arguments:
+{&quot;a&quot;: 1423, &quot;b&quot;: 123, &quot;operator&quot;: &quot;-&quot;}
+***************************************************************************
+***** Suggested tool call (call_kHRXi8vq5XsZSrGDnVTA1oy7): calculator *****
+Arguments:
+{&quot;a&quot;: 32, &quot;b&quot;: 23, &quot;operator&quot;: &quot;+&quot;}
+***************************************************************************
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; EXECUTING FUNCTION calculator...
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; EXECUTING FUNCTION calculator...
+User (to Assistant):
+
+User (to Assistant):
+
+***** Response from calling tool (call_pSJXJKu1qbfRV4SVNHzTaG1z) *****
+1300
+**********************************************************************
+
+--------------------------------------------------------------------------------
+User (to Assistant):
+
+***** Response from calling tool (call_kHRXi8vq5XsZSrGDnVTA1oy7) *****
+55
+**********************************************************************
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; USING AUTO REPLY...
+Assistant (to User):
+
+***** Suggested tool call (call_srDG3bYDpkdoIVn1mVVJNTJj): calculator *****
+Arguments:
+{&quot;a&quot;: 1300, &quot;b&quot;: 3, &quot;operator&quot;: &quot;/&quot;}
+***************************************************************************
+***** Suggested tool call (call_jXJHjxZlnsHEbLaG4hQXUX1v): calculator *****
+Arguments:
+{&quot;a&quot;: 55, &quot;b&quot;: 5, &quot;operator&quot;: &quot;*&quot;}
+***************************************************************************
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; EXECUTING FUNCTION calculator...
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; EXECUTING FUNCTION calculator...
+User (to Assistant):
+
+User (to Assistant):
+
+***** Response from calling tool (call_srDG3bYDpkdoIVn1mVVJNTJj) *****
+433
+**********************************************************************
+
+--------------------------------------------------------------------------------
+User (to Assistant):
+
+***** Response from calling tool (call_jXJHjxZlnsHEbLaG4hQXUX1v) *****
+275
+**********************************************************************
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; USING AUTO REPLY...
+Assistant (to User):
+
+***** Suggested tool call (call_jKyiL6oizDZPfX16hhVi6pa3): calculator *****
+Arguments:
+{&quot;a&quot;:433,&quot;b&quot;:275,&quot;operator&quot;:&quot;+&quot;}
+***************************************************************************
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; EXECUTING FUNCTION calculator...
+User (to Assistant):
+
+User (to Assistant):
+
+***** Response from calling tool (call_jKyiL6oizDZPfX16hhVi6pa3) *****
+708
+**********************************************************************
+
+--------------------------------------------------------------------------------
+
+&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; USING AUTO REPLY...
+Assistant (to User):
+
+The result of the expression \((1423 - 123) / 3 + (32 + 23) * 5\) is 708.
+
+&#39;TERMINATE&#39;
+
+--------------------------------------------------------------------------------
+</code></pre>
+</div>
+<div class="output stream stderr">
+<pre><code>🖇 AgentOps: This run&#39;s cost $0.000600
+🖇 AgentOps: Session Replay: https://app.agentops.ai/drilldown?session_id=51556b00-428b-4cae-b815-1320ebc7e810
+</code></pre>
+</div>
+</div>
+<div id="f67b0305-1247-489e-b1b0-829127af76d3" class="cell markdown">
+<p>You can see your run in action at <a
+href="app.agentops.ai">app.agentops.ai</a>. In this example, the
+AgentOps dashboard will show:</p>
+<ul>
+<li>Agents talking to each other</li>
+<li>Each use of the calculator tool</li>
+<li>Each call to OpenAI for LLM use</li>
+</ul>
+</div>
+<div id="0b8919ec-ff81-4c94-95de-0d2c5dabbdd9" class="cell code">
+<div class="sourceCode" id="cb11"><pre
+class="sourceCode python"><code class="sourceCode python"></code></pre></div>
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/crew/job_posting.html b/docs/v1/examples/notebooks/crew/job_posting.html
new file mode 100644
index 00000000..a03f65d5
--- /dev/null
+++ b/docs/v1/examples/notebooks/crew/job_posting.html
@@ -0,0 +1,291 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>job_posting</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div class="cell code">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># %pip install -e ../..</span></span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U <span class="st">&#39;crewai[tools]&#39;</span></span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U <span class="st">&#39;crewai[agentops]&#39;</span></span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;SERPER_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;...&quot;</span></span>
+<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;OPENAI_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;...&quot;</span></span>
+<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;...&quot;</span></span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> crewai <span class="im">import</span> Agent</span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> crewai_tools.tools <span class="im">import</span> WebsiteSearchTool, SerperDevTool, FileReadTool</span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a>web_search_tool <span class="op">=</span> WebsiteSearchTool()</span>
+<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a>serper_dev_tool <span class="op">=</span> SerperDevTool()</span>
+<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>file_read_tool <span class="op">=</span> FileReadTool(</span>
+<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> file_path<span class="op">=</span><span class="st">&quot;job_description_example.md&quot;</span>,</span>
+<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> description<span class="op">=</span><span class="st">&quot;A tool to read the job description example file.&quot;</span>,</span>
+<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a><span class="kw">class</span> Agents:</span>
+<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> research_agent(<span class="va">self</span>):</span>
+<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Agent(</span>
+<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> role<span class="op">=</span><span class="st">&quot;Research Analyst&quot;</span>,</span>
+<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a> goal<span class="op">=</span><span class="st">&quot;Analyze the company website and provided description to extract insights on culture, values, and specific needs.&quot;</span>,</span>
+<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a> tools<span class="op">=</span>[web_search_tool, serper_dev_tool],</span>
+<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a> backstory<span class="op">=</span><span class="st">&quot;Expert in analyzing company cultures and identifying key values and needs from various sources, including websites and brief descriptions.&quot;</span>,</span>
+<span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a> verbose<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> writer_agent(<span class="va">self</span>):</span>
+<span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Agent(</span>
+<span id="cb4-24"><a href="#cb4-24" aria-hidden="true" tabindex="-1"></a> role<span class="op">=</span><span class="st">&quot;Job Description Writer&quot;</span>,</span>
+<span id="cb4-25"><a href="#cb4-25" aria-hidden="true" tabindex="-1"></a> goal<span class="op">=</span><span class="st">&quot;Use insights from the Research Analyst to create a detailed, engaging, and enticing job posting.&quot;</span>,</span>
+<span id="cb4-26"><a href="#cb4-26" aria-hidden="true" tabindex="-1"></a> tools<span class="op">=</span>[web_search_tool, serper_dev_tool, file_read_tool],</span>
+<span id="cb4-27"><a href="#cb4-27" aria-hidden="true" tabindex="-1"></a> backstory<span class="op">=</span><span class="st">&quot;Skilled in crafting compelling job descriptions that resonate with the company&#39;s values and attract the right candidates.&quot;</span>,</span>
+<span id="cb4-28"><a href="#cb4-28" aria-hidden="true" tabindex="-1"></a> verbose<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb4-29"><a href="#cb4-29" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb4-30"><a href="#cb4-30" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-31"><a href="#cb4-31" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> review_agent(<span class="va">self</span>):</span>
+<span id="cb4-32"><a href="#cb4-32" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Agent(</span>
+<span id="cb4-33"><a href="#cb4-33" aria-hidden="true" tabindex="-1"></a> role<span class="op">=</span><span class="st">&quot;Review and Editing Specialist&quot;</span>,</span>
+<span id="cb4-34"><a href="#cb4-34" aria-hidden="true" tabindex="-1"></a> goal<span class="op">=</span><span class="st">&quot;Review the job posting for clarity, engagement, grammatical accuracy, and alignment with company values and refine it to ensure perfection.&quot;</span>,</span>
+<span id="cb4-35"><a href="#cb4-35" aria-hidden="true" tabindex="-1"></a> tools<span class="op">=</span>[web_search_tool, serper_dev_tool, file_read_tool],</span>
+<span id="cb4-36"><a href="#cb4-36" aria-hidden="true" tabindex="-1"></a> backstory<span class="op">=</span><span class="st">&quot;A meticulous editor with an eye for detail, ensuring every piece of content is clear, engaging, and grammatically perfect.&quot;</span>,</span>
+<span id="cb4-37"><a href="#cb4-37" aria-hidden="true" tabindex="-1"></a> verbose<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb4-38"><a href="#cb4-38" aria-hidden="true" tabindex="-1"></a> )</span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> textwrap <span class="im">import</span> dedent</span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> crewai <span class="im">import</span> Task</span>
+<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="kw">class</span> Tasks:</span>
+<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> research_company_culture_task(<span class="va">self</span>, agent, company_description, company_domain):</span>
+<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Task(</span>
+<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> description<span class="op">=</span>dedent(</span>
+<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> <span class="ss">f&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a><span class="ss"> Analyze the provided company website and the hiring manager&#39;s company&#39;s domain </span><span class="sc">{</span>company_domain<span class="sc">}</span><span class="ss">, description: &quot;</span><span class="sc">{</span>company_description<span class="sc">}</span><span class="ss">&quot;. Focus on understanding the company&#39;s culture, values, and mission. Identify unique selling points and specific projects or achievements highlighted on the site.</span></span>
+<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a><span class="ss"> Compile a report summarizing these insights, specifically how they can be leveraged in a job posting to attract the right candidates.&quot;&quot;&quot;</span></span>
+<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a> expected_output<span class="op">=</span>dedent(</span>
+<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a><span class="st"> A comprehensive report detailing the company&#39;s culture, values, and mission, along with specific selling points relevant to the job role. Suggestions on incorporating these insights into the job posting should be included.&quot;&quot;&quot;</span></span>
+<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a> agent<span class="op">=</span>agent,</span>
+<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-20"><a href="#cb5-20" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> research_role_requirements_task(<span class="va">self</span>, agent, hiring_needs):</span>
+<span id="cb5-21"><a href="#cb5-21" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Task(</span>
+<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a> description<span class="op">=</span>dedent(</span>
+<span id="cb5-23"><a href="#cb5-23" aria-hidden="true" tabindex="-1"></a> <span class="ss">f&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-24"><a href="#cb5-24" aria-hidden="true" tabindex="-1"></a><span class="ss"> Based on the hiring manager&#39;s needs: &quot;</span><span class="sc">{</span>hiring_needs<span class="sc">}</span><span class="ss">&quot;, identify the key skills, experiences, and qualities the ideal candidate should possess for the role. Consider the company&#39;s current projects, its competitive landscape, and industry trends. Prepare a list of recommended job requirements and qualifications that align with the company&#39;s needs and values.&quot;&quot;&quot;</span></span>
+<span id="cb5-25"><a href="#cb5-25" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-26"><a href="#cb5-26" aria-hidden="true" tabindex="-1"></a> expected_output<span class="op">=</span>dedent(</span>
+<span id="cb5-27"><a href="#cb5-27" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-28"><a href="#cb5-28" aria-hidden="true" tabindex="-1"></a><span class="st"> A list of recommended skills, experiences, and qualities for the ideal candidate, aligned with the company&#39;s culture, ongoing projects, and the specific role&#39;s requirements.&quot;&quot;&quot;</span></span>
+<span id="cb5-29"><a href="#cb5-29" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-30"><a href="#cb5-30" aria-hidden="true" tabindex="-1"></a> agent<span class="op">=</span>agent,</span>
+<span id="cb5-31"><a href="#cb5-31" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb5-32"><a href="#cb5-32" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-33"><a href="#cb5-33" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> draft_job_posting_task(</span>
+<span id="cb5-34"><a href="#cb5-34" aria-hidden="true" tabindex="-1"></a> <span class="va">self</span>, agent, company_description, hiring_needs, specific_benefits</span>
+<span id="cb5-35"><a href="#cb5-35" aria-hidden="true" tabindex="-1"></a> ):</span>
+<span id="cb5-36"><a href="#cb5-36" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Task(</span>
+<span id="cb5-37"><a href="#cb5-37" aria-hidden="true" tabindex="-1"></a> description<span class="op">=</span>dedent(</span>
+<span id="cb5-38"><a href="#cb5-38" aria-hidden="true" tabindex="-1"></a> <span class="ss">f&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-39"><a href="#cb5-39" aria-hidden="true" tabindex="-1"></a><span class="ss"> Draft a job posting for the role described by the hiring manager: &quot;</span><span class="sc">{</span>hiring_needs<span class="sc">}</span><span class="ss">&quot;. Use the insights on &quot;</span><span class="sc">{</span>company_description<span class="sc">}</span><span class="ss">&quot; to start with a compelling introduction, followed by a detailed role description, responsibilities, and required skills and qualifications. Ensure the tone aligns with the company&#39;s culture and incorporate any unique benefits or opportunities offered by the company.</span></span>
+<span id="cb5-40"><a href="#cb5-40" aria-hidden="true" tabindex="-1"></a><span class="ss"> Specfic benefits: &quot;</span><span class="sc">{</span>specific_benefits<span class="sc">}</span><span class="ss">&quot;&quot;&quot;</span></span>
+<span id="cb5-41"><a href="#cb5-41" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-42"><a href="#cb5-42" aria-hidden="true" tabindex="-1"></a> expected_output<span class="op">=</span>dedent(</span>
+<span id="cb5-43"><a href="#cb5-43" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-44"><a href="#cb5-44" aria-hidden="true" tabindex="-1"></a><span class="st"> A detailed, engaging job posting that includes an introduction, role description, responsibilities, requirements, and unique company benefits. The tone should resonate with the company&#39;s culture and values, aimed at attracting the right candidates.&quot;&quot;&quot;</span></span>
+<span id="cb5-45"><a href="#cb5-45" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-46"><a href="#cb5-46" aria-hidden="true" tabindex="-1"></a> agent<span class="op">=</span>agent,</span>
+<span id="cb5-47"><a href="#cb5-47" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb5-48"><a href="#cb5-48" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-49"><a href="#cb5-49" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> review_and_edit_job_posting_task(<span class="va">self</span>, agent, hiring_needs):</span>
+<span id="cb5-50"><a href="#cb5-50" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Task(</span>
+<span id="cb5-51"><a href="#cb5-51" aria-hidden="true" tabindex="-1"></a> description<span class="op">=</span>dedent(</span>
+<span id="cb5-52"><a href="#cb5-52" aria-hidden="true" tabindex="-1"></a> <span class="ss">f&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-53"><a href="#cb5-53" aria-hidden="true" tabindex="-1"></a><span class="ss"> Review the draft job posting for the role: &quot;</span><span class="sc">{</span>hiring_needs<span class="sc">}</span><span class="ss">&quot;. Check for clarity, engagement, grammatical accuracy, and alignment with the company&#39;s culture and values. Edit and refine the content, ensuring it speaks directly to the desired candidates and accurately reflects the role&#39;s unique benefits and opportunities. Provide feedback for any necessary revisions.&quot;&quot;&quot;</span></span>
+<span id="cb5-54"><a href="#cb5-54" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-55"><a href="#cb5-55" aria-hidden="true" tabindex="-1"></a> expected_output<span class="op">=</span>dedent(</span>
+<span id="cb5-56"><a href="#cb5-56" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-57"><a href="#cb5-57" aria-hidden="true" tabindex="-1"></a><span class="st"> A polished, error-free job posting that is clear, engaging, and perfectly aligned with the company&#39;s culture and values. Feedback on potential improvements and final approval for publishing. Formated in markdown.&quot;&quot;&quot;</span></span>
+<span id="cb5-58"><a href="#cb5-58" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-59"><a href="#cb5-59" aria-hidden="true" tabindex="-1"></a> agent<span class="op">=</span>agent,</span>
+<span id="cb5-60"><a href="#cb5-60" aria-hidden="true" tabindex="-1"></a> output_file<span class="op">=</span><span class="st">&quot;job_posting.md&quot;</span>,</span>
+<span id="cb5-61"><a href="#cb5-61" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb5-62"><a href="#cb5-62" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-63"><a href="#cb5-63" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> industry_analysis_task(<span class="va">self</span>, agent, company_domain, company_description):</span>
+<span id="cb5-64"><a href="#cb5-64" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> Task(</span>
+<span id="cb5-65"><a href="#cb5-65" aria-hidden="true" tabindex="-1"></a> description<span class="op">=</span>dedent(</span>
+<span id="cb5-66"><a href="#cb5-66" aria-hidden="true" tabindex="-1"></a> <span class="ss">f&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-67"><a href="#cb5-67" aria-hidden="true" tabindex="-1"></a><span class="ss"> Conduct an in-depth analysis of the industry related to the company&#39;s domain: &quot;</span><span class="sc">{</span>company_domain<span class="sc">}</span><span class="ss">&quot;. Investigate current trends, challenges, and opportunities within the industry, utilizing market reports, recent developments, and expert opinions. Assess how these factors could impact the role being hired for and the overall attractiveness of the position to potential candidates.</span></span>
+<span id="cb5-68"><a href="#cb5-68" aria-hidden="true" tabindex="-1"></a><span class="ss"> Consider how the company&#39;s position within this industry and its response to these trends could be leveraged to attract top talent. Include in your report how the role contributes to addressing industry challenges or seizing opportunities.&quot;&quot;&quot;</span></span>
+<span id="cb5-69"><a href="#cb5-69" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-70"><a href="#cb5-70" aria-hidden="true" tabindex="-1"></a> expected_output<span class="op">=</span>dedent(</span>
+<span id="cb5-71"><a href="#cb5-71" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;&quot;&quot;</span><span class="ch">\</span></span>
+<span id="cb5-72"><a href="#cb5-72" aria-hidden="true" tabindex="-1"></a><span class="st"> A detailed analysis report that identifies major industry trends, challenges, and opportunities relevant to the company&#39;s domain and the specific job role. This report should provide strategic insights on positioning the job role and the company as an attractive choice for potential candidates.&quot;&quot;&quot;</span></span>
+<span id="cb5-73"><a href="#cb5-73" aria-hidden="true" tabindex="-1"></a> ),</span>
+<span id="cb5-74"><a href="#cb5-74" aria-hidden="true" tabindex="-1"></a> agent<span class="op">=</span>agent,</span>
+<span id="cb5-75"><a href="#cb5-75" aria-hidden="true" tabindex="-1"></a> )</span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb6"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> crewai <span class="im">import</span> Crew</span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a>agentops.init(tags<span class="op">=</span>[<span class="st">&quot;crew-job-posting-example&quot;</span>])</span>
+<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a>tasks <span class="op">=</span> Tasks()</span>
+<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a>agents <span class="op">=</span> Agents()</span>
+<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a>company_description <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;What is the company description?</span><span class="ch">\n</span><span class="st">&quot;</span>)</span>
+<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a>company_domain <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;What is the company domain?</span><span class="ch">\n</span><span class="st">&quot;</span>)</span>
+<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a>hiring_needs <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;What are the hiring needs?</span><span class="ch">\n</span><span class="st">&quot;</span>)</span>
+<span id="cb6-12"><a href="#cb6-12" aria-hidden="true" tabindex="-1"></a>specific_benefits <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;What are specific_benefits you offer?</span><span class="ch">\n</span><span class="st">&quot;</span>)</span>
+<span id="cb6-13"><a href="#cb6-13" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-14"><a href="#cb6-14" aria-hidden="true" tabindex="-1"></a><span class="co"># Create Agents</span></span>
+<span id="cb6-15"><a href="#cb6-15" aria-hidden="true" tabindex="-1"></a>researcher_agent <span class="op">=</span> agents.research_agent()</span>
+<span id="cb6-16"><a href="#cb6-16" aria-hidden="true" tabindex="-1"></a>writer_agent <span class="op">=</span> agents.writer_agent()</span>
+<span id="cb6-17"><a href="#cb6-17" aria-hidden="true" tabindex="-1"></a>review_agent <span class="op">=</span> agents.review_agent()</span>
+<span id="cb6-18"><a href="#cb6-18" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-19"><a href="#cb6-19" aria-hidden="true" tabindex="-1"></a><span class="co"># Define Tasks for each agent</span></span>
+<span id="cb6-20"><a href="#cb6-20" aria-hidden="true" tabindex="-1"></a>research_company_culture_task <span class="op">=</span> tasks.research_company_culture_task(</span>
+<span id="cb6-21"><a href="#cb6-21" aria-hidden="true" tabindex="-1"></a> researcher_agent, company_description, company_domain</span>
+<span id="cb6-22"><a href="#cb6-22" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb6-23"><a href="#cb6-23" aria-hidden="true" tabindex="-1"></a>industry_analysis_task <span class="op">=</span> tasks.industry_analysis_task(</span>
+<span id="cb6-24"><a href="#cb6-24" aria-hidden="true" tabindex="-1"></a> researcher_agent, company_domain, company_description</span>
+<span id="cb6-25"><a href="#cb6-25" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb6-26"><a href="#cb6-26" aria-hidden="true" tabindex="-1"></a>research_role_requirements_task <span class="op">=</span> tasks.research_role_requirements_task(</span>
+<span id="cb6-27"><a href="#cb6-27" aria-hidden="true" tabindex="-1"></a> researcher_agent, hiring_needs</span>
+<span id="cb6-28"><a href="#cb6-28" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb6-29"><a href="#cb6-29" aria-hidden="true" tabindex="-1"></a>draft_job_posting_task <span class="op">=</span> tasks.draft_job_posting_task(</span>
+<span id="cb6-30"><a href="#cb6-30" aria-hidden="true" tabindex="-1"></a> writer_agent, company_description, hiring_needs, specific_benefits</span>
+<span id="cb6-31"><a href="#cb6-31" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb6-32"><a href="#cb6-32" aria-hidden="true" tabindex="-1"></a>review_and_edit_job_posting_task <span class="op">=</span> tasks.review_and_edit_job_posting_task(</span>
+<span id="cb6-33"><a href="#cb6-33" aria-hidden="true" tabindex="-1"></a> review_agent, hiring_needs</span>
+<span id="cb6-34"><a href="#cb6-34" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb6-35"><a href="#cb6-35" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-36"><a href="#cb6-36" aria-hidden="true" tabindex="-1"></a><span class="co"># Instantiate the crew with a sequential process</span></span>
+<span id="cb6-37"><a href="#cb6-37" aria-hidden="true" tabindex="-1"></a>crew <span class="op">=</span> Crew(</span>
+<span id="cb6-38"><a href="#cb6-38" aria-hidden="true" tabindex="-1"></a> agents<span class="op">=</span>[researcher_agent, writer_agent, review_agent],</span>
+<span id="cb6-39"><a href="#cb6-39" aria-hidden="true" tabindex="-1"></a> tasks<span class="op">=</span>[</span>
+<span id="cb6-40"><a href="#cb6-40" aria-hidden="true" tabindex="-1"></a> research_company_culture_task,</span>
+<span id="cb6-41"><a href="#cb6-41" aria-hidden="true" tabindex="-1"></a> industry_analysis_task,</span>
+<span id="cb6-42"><a href="#cb6-42" aria-hidden="true" tabindex="-1"></a> research_role_requirements_task,</span>
+<span id="cb6-43"><a href="#cb6-43" aria-hidden="true" tabindex="-1"></a> draft_job_posting_task,</span>
+<span id="cb6-44"><a href="#cb6-44" aria-hidden="true" tabindex="-1"></a> review_and_edit_job_posting_task,</span>
+<span id="cb6-45"><a href="#cb6-45" aria-hidden="true" tabindex="-1"></a> ],</span>
+<span id="cb6-46"><a href="#cb6-46" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb6-47"><a href="#cb6-47" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-48"><a href="#cb6-48" aria-hidden="true" tabindex="-1"></a><span class="co"># Kick off the process</span></span>
+<span id="cb6-49"><a href="#cb6-49" aria-hidden="true" tabindex="-1"></a>result <span class="op">=</span> crew.kickoff()</span>
+<span id="cb6-50"><a href="#cb6-50" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-51"><a href="#cb6-51" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;Job Posting Creation Process Completed.&quot;</span>)</span>
+<span id="cb6-52"><a href="#cb6-52" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;Final Job Posting:&quot;</span>)</span>
+<span id="cb6-53"><a href="#cb6-53" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(result)</span>
+<span id="cb6-54"><a href="#cb6-54" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-55"><a href="#cb6-55" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+</div>
+<div class="cell markdown">
+
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/generate.py b/docs/v1/examples/notebooks/generate.py
new file mode 100644
index 00000000..ee60388a
--- /dev/null
+++ b/docs/v1/examples/notebooks/generate.py
@@ -0,0 +1,50 @@
+import os
+import subprocess
+
+# Before generating, `brew install pandoc`
+
+
+import os
+import subprocess
+
+
+def convert_notebooks_to_html(source_dir: str, target_dir: str):
+ # Ensure the target directory exists
+ os.makedirs(target_dir, exist_ok=True)
+
+ # Loop over all files in the source directory and subdirectories
+ for root, dirs, files in os.walk(source_dir):
+ for filename in files:
+ # Check if current file has a .ipynb extension
+ if filename.endswith(".ipynb"):
+ # Construct full file path
+ source_file = os.path.join(root, filename)
+ # Create a mirrored directory structure in the target directory
+ relative_dir = os.path.relpath(root, source_dir)
+ html_target_dir = os.path.join(target_dir, relative_dir)
+ os.makedirs(html_target_dir, exist_ok=True)
+ # Construct target file path
+ html_target_file = os.path.join(
+ html_target_dir, filename[:-6] + ".html"
+ ) # remove '.ipynb' and add '.html'
+
+ # Convert notebook to HTML using pandoc
+ subprocess.check_call(
+ "pandoc {source_file} -s -o {html_target_file} -c https://app.agentops.ai/notebook_styles.css && "
+ "{{ echo '<!-- This file was generated by Pandoc -->'; cat {html_target_file}; }} > temp.md && mv temp.md {html_target_file}".format(
+ source_file=source_file, html_target_file=html_target_file
+ ),
+ shell=True,
+ )
+
+
+# Example usage:
+try:
+ convert_notebooks_to_html("../../../../examples", "./")
+except FileNotFoundError:
+ try:
+ convert_notebooks_to_html("docs/v1/examples", "./")
+ except FileNotFoundError:
+ print(
+ "Could not find notebooks folder. Run this script from project root or at the script location."
+ )
diff --git a/docs/v1/examples/notebooks/langchain_examples.html b/docs/v1/examples/notebooks/langchain_examples.html
new file mode 100644
index 00000000..9712fc7d
--- /dev/null
+++ b/docs/v1/examples/notebooks/langchain_examples.html
@@ -0,0 +1,287 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>langchain_examples</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div id="e0deea1ab1db2a19" class="cell markdown">
+<h1 id="agentops-langchain-agent-implementation">AgentOps Langchain
+Agent Implementation</h1>
+<p>Using AgentOps monitoring with Langchain is simple. We've created a
+LangchainCallbackHandler that will do all of the heavy lifting!</p>
+<p>First we'll import the typical Langchain packages:</p>
+</div>
+<div id="initial_id" class="cell code">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> langchain.chat_models <span class="im">import</span> ChatOpenAI</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> langchain.agents <span class="im">import</span> initialize_agent, AgentType</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> langchain.agents <span class="im">import</span> tool</span></code></pre></div>
+</div>
+<div id="57ddb8eca4e8a3cb" class="cell markdown">
+<p>The only difference with using AgentOps is that we'll also import
+this special Callback Handler</p>
+</div>
+<div id="7e8f8cd098ad5b57" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops.partners.langchain_callback_handler <span class="im">import</span> (</span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> LangchainCallbackHandler <span class="im">as</span> AgentOpsLangchainCallbackHandler,</span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="14a1b8e08a2e9eb3" class="cell markdown" data-collapsed="false">
+<p>Next, we'll grab our two API keys. You can use dotenv like below or
+however else you like to load environment variables</p>
+</div>
+<div id="ff6cfc570599871f" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> dotenv <span class="im">import</span> load_dotenv</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>load_dotenv()</span></code></pre></div>
+</div>
+<div id="51f083697b783fa4" class="cell markdown" data-collapsed="false">
+<p>This is where AgentOps comes into play. Before creating our LLM
+instance via Langchain, first we'll create an instance of the AO
+LangchainCallbackHandler. After the handler is initialized, a session
+will be recorded automatically.</p>
+<p>Pass in your API key, and optionally any tags to describe this
+session for easier lookup in the AO dashboard.</p>
+</div>
+<div id="d432fe915edb6365" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>AGENTOPS_API_KEY <span class="op">=</span> os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>)</span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>OPENAI_API_KEY <span class="op">=</span> os.environ.get(<span class="st">&quot;OPENAI_API_KEY&quot;</span>)</span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a>agentops_handler <span class="op">=</span> AgentOpsLangchainCallbackHandler(</span>
+<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>AGENTOPS_API_KEY, tags<span class="op">=</span>[<span class="st">&quot;Langchain Example&quot;</span>]</span>
+<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a>llm <span class="op">=</span> ChatOpenAI(</span>
+<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> openai_api_key<span class="op">=</span>OPENAI_API_KEY, callbacks<span class="op">=</span>[agentops_handler], model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span></span>
+<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="38d309f07363b58e" class="cell markdown" data-collapsed="false">
+<p>You can also retrieve the <code>session_id</code> of the newly
+created session.</p>
+</div>
+<div id="f7e3a37cde3f9c22" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;Agent Ops session ID: &quot;</span> <span class="op">+</span> <span class="bu">str</span>(agentops_handler.session_id))</span></code></pre></div>
+</div>
+<div id="42f226ace56ef6f5" class="cell markdown" data-collapsed="false">
+<p>Agents generally use tools. Let's define a simple tool here. Tool
+usage is also recorded.</p>
+</div>
+<div id="c103a2edbe837abd" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb6"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="at">@tool</span></span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> find_movie(genre) <span class="op">-&gt;</span> <span class="bu">str</span>:</span>
+<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="co">&quot;&quot;&quot;Find available movies&quot;&quot;&quot;</span></span>
+<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> genre <span class="op">==</span> <span class="st">&quot;drama&quot;</span>:</span>
+<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="st">&quot;Dune 2&quot;</span></span>
+<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span>:</span>
+<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="st">&quot;Pineapple Express&quot;</span></span>
+<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a>tools <span class="op">=</span> [find_movie]</span></code></pre></div>
+</div>
+<div id="4fb7633857b19bf0" class="cell markdown" data-collapsed="false">
+<p>For each tool, you need to also add the callback handler</p>
+</div>
+<div id="a0345f08bf1c5ecd" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb7"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> t <span class="kw">in</span> tools:</span>
+<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> t.callbacks <span class="op">=</span> [agentops_handler]</span></code></pre></div>
+</div>
+<div id="12a02b833716676b" class="cell markdown" data-collapsed="false">
+<p>Finally, let's use our agent! Pass in the callback handler to the
+agent, and all the actions will be recorded in the AO Dashboard</p>
+</div>
+<div id="2d2e83fa69b30add" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb8"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>agent <span class="op">=</span> initialize_agent(</span>
+<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> tools,</span>
+<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a> llm,</span>
+<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a> agent<span class="op">=</span>AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,</span>
+<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a> verbose<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> callbacks<span class="op">=</span>[</span>
+<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> agentops_handler</span>
+<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a> ], <span class="co"># You must pass in a callback handler to record your agent</span></span>
+<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a> handle_parsing_errors<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="df2bc3a384493e1e" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb9"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>agent.run(<span class="st">&quot;What comedies are playing?&quot;</span>, callbacks<span class="op">=</span>[agentops_handler])</span></code></pre></div>
+</div>
+<div id="2230edd919182a55" class="cell markdown" data-collapsed="false">
+<h2 id="check-your-session">Check your session</h2>
+<p>Finally, check your run on <a
+href="https://app.agentops.ai">AgentOps</a> <img
+src="2230edd919182a55-3d9393fa-3d6a-4193-b6c9-43413dc19d15.png"
+alt="image.png" /></p>
+</div>
+<div id="fbf4a3ec5fa60d74" class="cell markdown" data-collapsed="false">
+<h1 id="async-agents">Async Agents</h1>
+<p>Several langchain agents require async callback handlers. AgentOps
+also supports this.</p>
+</div>
+<div id="ed63a166b343e1a2" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb10"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> langchain.chat_models <span class="im">import</span> ChatOpenAI</span>
+<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> langchain.agents <span class="im">import</span> initialize_agent, AgentType</span>
+<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> langchain.agents <span class="im">import</span> tool</span></code></pre></div>
+</div>
+<div id="aa15223969f97b3d" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb11"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops.partners.langchain_callback_handler <span class="im">import</span> (</span>
+<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> AsyncLangchainCallbackHandler <span class="im">as</span> AgentOpsAsyncLangchainCallbackHandler,</span>
+<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="818357483f039b60" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb12"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> dotenv <span class="im">import</span> load_dotenv</span>
+<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a>load_dotenv()</span>
+<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a>AGENTOPS_API_KEY <span class="op">=</span> os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>)</span>
+<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a>OPENAI_API_KEY <span class="op">=</span> os.environ.get(<span class="st">&quot;OPENAI_API_KEY&quot;</span>)</span></code></pre></div>
+</div>
+<div id="ae76cfe058f5e4e4" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb13"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>agentops_handler <span class="op">=</span> AgentOpsAsyncLangchainCallbackHandler(</span>
+<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>AGENTOPS_API_KEY, tags<span class="op">=</span>[<span class="st">&quot;Async Example&quot;</span>]</span>
+<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a>llm <span class="op">=</span> ChatOpenAI(</span>
+<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a> openai_api_key<span class="op">=</span>OPENAI_API_KEY, callbacks<span class="op">=</span>[agentops_handler], model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span></span>
+<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;Agent Ops session ID: &quot;</span> <span class="op">+</span> <span class="bu">str</span>(<span class="cf">await</span> agentops_handler.session_id))</span></code></pre></div>
+</div>
+<div id="1201049766be84a7" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb14"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="at">@tool</span></span>
+<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> find_movie(genre) <span class="op">-&gt;</span> <span class="bu">str</span>:</span>
+<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a> <span class="co">&quot;&quot;&quot;Find available movies&quot;&quot;&quot;</span></span>
+<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> genre <span class="op">==</span> <span class="st">&quot;drama&quot;</span>:</span>
+<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="st">&quot;Dune 2&quot;</span></span>
+<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span>:</span>
+<span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="st">&quot;Pineapple Express&quot;</span></span>
+<span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb14-9"><a href="#cb14-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb14-10"><a href="#cb14-10" aria-hidden="true" tabindex="-1"></a>tools <span class="op">=</span> [find_movie]</span>
+<span id="cb14-11"><a href="#cb14-11" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb14-12"><a href="#cb14-12" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> t <span class="kw">in</span> tools:</span>
+<span id="cb14-13"><a href="#cb14-13" aria-hidden="true" tabindex="-1"></a> t.callbacks <span class="op">=</span> [agentops_handler]</span></code></pre></div>
+</div>
+<div id="8d4f9dd39b79d542" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb15"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>agent <span class="op">=</span> initialize_agent(</span>
+<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a> tools,</span>
+<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a> llm,</span>
+<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a> agent<span class="op">=</span>AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,</span>
+<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a> verbose<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a> handle_parsing_errors<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb15-7"><a href="#cb15-7" aria-hidden="true" tabindex="-1"></a> callbacks<span class="op">=</span>[agentops_handler],</span>
+<span id="cb15-8"><a href="#cb15-8" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb15-9"><a href="#cb15-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb15-10"><a href="#cb15-10" aria-hidden="true" tabindex="-1"></a><span class="cf">await</span> agent.arun(<span class="st">&quot;What comedies are playing?&quot;</span>)</span></code></pre></div>
+</div>
+<div id="fb276a2e-f1c3-4f0f-8818-b7730e9d3ff7" class="cell markdown"
+data-collapsed="false">
+<h2 id="check-your-session">Check your session</h2>
+<p>Finally, check your run on <a
+href="https://app.agentops.ai">AgentOps</a></p>
+<p><img
+src="fb276a2e-f1c3-4f0f-8818-b7730e9d3ff7-69f2121a-d437-4c09-bbbe-c76c9243ee19.png"
+alt="image.png" /></p>
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/multi_agent_example.html b/docs/v1/examples/notebooks/multi_agent_example.html
new file mode 100644
index 00000000..941fa0e0
--- /dev/null
+++ b/docs/v1/examples/notebooks/multi_agent_example.html
@@ -0,0 +1,212 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>multi_agent_example</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div id="a2e266428cefc683" class="cell markdown" data-collapsed="false">
+<h1 id="multi-agent-support">Multi-Agent Support</h1>
+<p>This is an example implementation of tracking events from two
+separate agents</p>
+</div>
+<div id="7c566fac57d3b6ce" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops.agent <span class="im">import</span> track_agent</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> dotenv <span class="im">import</span> load_dotenv</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> openai <span class="im">import</span> OpenAI</span>
+<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> logging</span>
+<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> IPython.display <span class="im">import</span> display, Markdown</span></code></pre></div>
+</div>
+<div id="9f8c52496c04693" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>load_dotenv()</span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>OPENAI_API_KEY <span class="op">=</span> os.getenv(<span class="st">&quot;OPENAI_API_KEY&quot;</span>, <span class="st">&quot;&lt;your_openai_key&gt;&quot;</span>)</span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>AGENTOPS_API_KEY <span class="op">=</span> os.getenv(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>, <span class="st">&quot;&lt;your_agentops_key&gt;&quot;</span>)</span>
+<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>logging.basicConfig(</span>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> level<span class="op">=</span>logging.DEBUG</span>
+<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a>) <span class="co"># this will let us see that calls are assigned to an agent</span></span></code></pre></div>
+</div>
+<div id="af062552554d60ce" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>agentops.init(AGENTOPS_API_KEY, tags<span class="op">=</span>[<span class="st">&quot;multi-agent-notebook&quot;</span>])</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>openai_client <span class="op">=</span> OpenAI(api_key<span class="op">=</span>OPENAI_API_KEY)</span></code></pre></div>
+</div>
+<div id="95d212546aaf1f82" class="cell markdown" data-collapsed="false">
+<p>Now lets create a few agents!</p>
+</div>
+<div id="727e3cc26ce3ec3" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="at">@track_agent</span>(name<span class="op">=</span><span class="st">&quot;qa&quot;</span>)</span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="kw">class</span> QaAgent:</span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> completion(<span class="va">self</span>, prompt: <span class="bu">str</span>):</span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> res <span class="op">=</span> openai_client.chat.completions.create(</span>
+<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>,</span>
+<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> messages<span class="op">=</span>[</span>
+<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> {</span>
+<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;role&quot;</span>: <span class="st">&quot;system&quot;</span>,</span>
+<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;content&quot;</span>: <span class="st">&quot;You are a qa engineer and only output python code, no markdown tags.&quot;</span>,</span>
+<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> },</span>
+<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a> {<span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>, <span class="st">&quot;content&quot;</span>: prompt},</span>
+<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a> ],</span>
+<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a> temperature<span class="op">=</span><span class="fl">0.5</span>,</span>
+<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> res.choices[<span class="dv">0</span>].message.content</span>
+<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a><span class="at">@track_agent</span>(name<span class="op">=</span><span class="st">&quot;engineer&quot;</span>)</span>
+<span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a><span class="kw">class</span> EngineerAgent:</span>
+<span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> completion(<span class="va">self</span>, prompt: <span class="bu">str</span>):</span>
+<span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a> res <span class="op">=</span> openai_client.chat.completions.create(</span>
+<span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>,</span>
+<span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a> messages<span class="op">=</span>[</span>
+<span id="cb4-24"><a href="#cb4-24" aria-hidden="true" tabindex="-1"></a> {</span>
+<span id="cb4-25"><a href="#cb4-25" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;role&quot;</span>: <span class="st">&quot;system&quot;</span>,</span>
+<span id="cb4-26"><a href="#cb4-26" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;content&quot;</span>: <span class="st">&quot;You are a software engineer and only output python code, no markdown tags.&quot;</span>,</span>
+<span id="cb4-27"><a href="#cb4-27" aria-hidden="true" tabindex="-1"></a> },</span>
+<span id="cb4-28"><a href="#cb4-28" aria-hidden="true" tabindex="-1"></a> {<span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>, <span class="st">&quot;content&quot;</span>: prompt},</span>
+<span id="cb4-29"><a href="#cb4-29" aria-hidden="true" tabindex="-1"></a> ],</span>
+<span id="cb4-30"><a href="#cb4-30" aria-hidden="true" tabindex="-1"></a> temperature<span class="op">=</span><span class="fl">0.5</span>,</span>
+<span id="cb4-31"><a href="#cb4-31" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb4-32"><a href="#cb4-32" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> res.choices[<span class="dv">0</span>].message.content</span></code></pre></div>
+</div>
+<div id="79b75d65de738522" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>qa <span class="op">=</span> QaAgent()</span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>engineer <span class="op">=</span> EngineerAgent()</span></code></pre></div>
+</div>
+<div id="69dd3af9206308cc" class="cell markdown" data-collapsed="false">
+<p>Now we have our agents and we tagged them with the
+<code>@track_agent</code> decorator. Any LLM calls that go through this
+class will now be tagged as agent calls in AgentOps.</p>
+<p>Lets use these agents!</p>
+</div>
+<div id="830b86dac47dceb3" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb6"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>display(Markdown(<span class="st">&quot;```python</span><span class="ch">\n</span><span class="st">&quot;</span> <span class="op">+</span> generated_func <span class="op">+</span> <span class="st">&quot;</span><span class="ch">\n</span><span class="st">```&quot;</span>))</span></code></pre></div>
+</div>
+<div id="63c9d0d457aee91a" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb7"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>generated_test <span class="op">=</span> qa.completion(</span>
+<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;Write a python unit test that test the following function: </span><span class="ch">\n</span><span class="st"> &quot;</span> <span class="op">+</span> generated_func</span>
+<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="a88ffcbd2015d422" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb8"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>display(Markdown(<span class="st">&quot;```python</span><span class="ch">\n</span><span class="st">&quot;</span> <span class="op">+</span> generated_test <span class="op">+</span> <span class="st">&quot;</span><span class="ch">\n</span><span class="st">```&quot;</span>))</span></code></pre></div>
+</div>
+<div id="1bd312ed049a5511" class="cell markdown" data-collapsed="false">
+<p>Perfect! It generated the code as expected, and in the DEBUG logs,
+you can see that the calls were made by agents named "engineer" and
+"qa"!</p>
+</div>
+<div id="cbd0817a31756397" class="cell markdown" data-collapsed="false">
+<p>Lets verify one more thing! If we make an LLM call outside of the
+context of a tracked agent, we want to make sure it gets assigned to the
+Default Agent.</p>
+</div>
+<div id="122e923cb07fd5f4" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb9"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>res <span class="op">=</span> openai_client.chat.completions.create(</span>
+<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>,</span>
+<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a> messages<span class="op">=</span>[</span>
+<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a> {<span class="st">&quot;role&quot;</span>: <span class="st">&quot;system&quot;</span>, <span class="st">&quot;content&quot;</span>: <span class="st">&quot;You are not a tracked agent&quot;</span>},</span>
+<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a> {<span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>, <span class="st">&quot;content&quot;</span>: <span class="st">&quot;Say hello&quot;</span>},</span>
+<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a> ],</span>
+<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a>res.choices[<span class="dv">0</span>].message.content</span></code></pre></div>
+</div>
+<div id="a30909020c6a1ada" class="cell markdown" data-collapsed="false">
+<p>You'll notice that we didn't log an agent name, so the AgentOps
+backend will assign it to the Default Agent for the session!</p>
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/multi_session_llm.html b/docs/v1/examples/notebooks/multi_session_llm.html
new file mode 100644
index 00000000..f9890d6e
--- /dev/null
+++ b/docs/v1/examples/notebooks/multi_session_llm.html
@@ -0,0 +1,212 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>multi_session_llm</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div id="a0fe80a38dec2f7b" class="cell markdown" data-collapsed="false">
+<h1 id="multiple-concurrent-sessions">Multiple Concurrent Sessions</h1>
+<p>This example will show you how to run multiple sessions concurrently,
+assigning LLM cals to a specific session.</p>
+</div>
+<div id="initial_id" class="cell code" data-collapsed="true">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> openai <span class="im">import</span> OpenAI</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> dotenv <span class="im">import</span> load_dotenv</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops <span class="im">import</span> ActionEvent</span>
+<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a>load_dotenv()</span></code></pre></div>
+</div>
+<div id="da9cf64965c86ee9" class="cell markdown" data-collapsed="false">
+<p>First, of course, lets init AgentOps. We're going to bypass creating
+a session automatically for the sake of showing it below.</p>
+</div>
+<div id="39af2cd027ce268" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>agentops.init(auto_start_session<span class="op">=</span><span class="va">False</span>)</span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>openai <span class="op">=</span> OpenAI()</span></code></pre></div>
+</div>
+<div id="9501d298aec35510" class="cell markdown" data-collapsed="false">
+<p>Now lets create two sessions, each with an identifiable tag.</p>
+</div>
+<div id="4f24d06dd29579ff" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>session_1 <span class="op">=</span> agentops.start_session(tags<span class="op">=</span>[<span class="st">&quot;multi-session-test-1&quot;</span>])</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>session_2 <span class="op">=</span> agentops.start_session(tags<span class="op">=</span>[<span class="st">&quot;multi-session-test-2&quot;</span>])</span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;session_id_1: </span><span class="sc">{}</span><span class="st">&quot;</span>.<span class="bu">format</span>(session_1.session_id))</span>
+<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&quot;session_id_2: </span><span class="sc">{}</span><span class="st">&quot;</span>.<span class="bu">format</span>(session_2.session_id))</span></code></pre></div>
+</div>
+<div id="38f373b7a8878a68" class="cell markdown" data-collapsed="false">
+<h2 id="llm-calls">LLM Calls</h2>
+<p>Now lets go ahead and make our first OpenAI LLM call. The challenge
+with having multiple sessions at the same time is that there is no way
+for AgentOps to know what LLM call is intended to pertain to what active
+session. This means we need to do a little extra work in one of two
+ways.</p>
+</div>
+<div id="8a2d65f5fcdb137" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>messages <span class="op">=</span> [{<span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>, <span class="st">&quot;content&quot;</span>: <span class="st">&quot;Hello&quot;</span>}]</span></code></pre></div>
+</div>
+<div id="e1859e37b65669b2" class="cell markdown" data-collapsed="false">
+<h3 id="patching-function">Patching Function</h3>
+<p>This method involves wrapping the LLM call withing a function on
+session. It can look a little counter-intuitive, but it easily tells us
+what session the call belongs to.</p>
+</div>
+<div id="106a1c899602bd33" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># option 1: use session.patch</span></span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>response <span class="op">=</span> session_1.patch(openai.chat.completions.create)(</span>
+<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>,</span>
+<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> messages<span class="op">=</span>messages,</span>
+<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> temperature<span class="op">=</span><span class="fl">0.5</span>,</span>
+<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="3e129661929e8368" class="cell markdown" data-collapsed="false">
+<h3 id="create-patched-function">Create patched function</h3>
+<p>If you're using the create function multiple times, you can create a
+new function with the same method</p>
+</div>
+<div id="be3b866ee04ef767" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb6"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>observed_create <span class="op">=</span> session_1.patch(openai.chat.completions.create)</span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>obs_response <span class="op">=</span> observed_create(</span>
+<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>,</span>
+<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> messages<span class="op">=</span>messages,</span>
+<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> temperature<span class="op">=</span><span class="fl">0.5</span>,</span>
+<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="ec03dbfb7a185d1d" class="cell markdown" data-collapsed="false">
+<h3 id="keyword-argument">Keyword Argument</h3>
+<p>Alternatively, you can also pass the session into the LLM function
+call as a keyword argument. While this method works and is a bit more
+readable, it is not a "pythonic" pattern and can lead to linting errors
+in the code, as the base function is not expecting a
+<code>session</code> keyword.</p>
+</div>
+<div id="4ad4c7629509b4be" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb7"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># option 2: add session as a keyword argument</span></span>
+<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>response2 <span class="op">=</span> openai.chat.completions.create(</span>
+<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>, messages<span class="op">=</span>messages, temperature<span class="op">=</span><span class="fl">0.5</span>, session<span class="op">=</span>session_2</span>
+<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="e6de84850aa2e135" class="cell markdown" data-collapsed="false">
+<h2 id="recording-events">Recording Events</h2>
+<p>Outside of LLM calls, there are plenty of other events that we want
+to track. You can learn more about these events <a
+href="https://docs.agentops.ai/v1/concepts/events">here</a>.</p>
+<p>Recording these events on a session is as simple as
+<code>session.record(...)</code></p>
+</div>
+<div id="964e3073bac33223" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb8"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>session_1.record(ActionEvent(action_type<span class="op">=</span><span class="st">&quot;test event&quot;</span>))</span></code></pre></div>
+</div>
+<div id="43ac0b9b99eab5c7" class="cell markdown" data-collapsed="false">
+<p>Now let's go ahead and end the sessions</p>
+</div>
+<div id="7e3050abcb72421b" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb9"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>session_1.end_session(end_state<span class="op">=</span><span class="st">&quot;Success&quot;</span>)</span>
+<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>session_2.end_session(end_state<span class="op">=</span><span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+</div>
+<div id="53ea2b8dfee6270a" class="cell markdown" data-collapsed="false">
+<p>If you look in the AgentOps dashboard for these sessions, you will
+see two unique sessions, both with one LLM Event each, one with an
+Action Event as well.</p>
+</div>
+<div id="dbc7483434f8c147" class="cell markdown" data-collapsed="false">
+
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/multion/Autonomous_web_browsing.html b/docs/v1/examples/notebooks/multion/Autonomous_web_browsing.html
new file mode 100644
index 00000000..5475e98a
--- /dev/null
+++ b/docs/v1/examples/notebooks/multion/Autonomous_web_browsing.html
@@ -0,0 +1,222 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>Autonomous_web_browsing</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<section id="multion-tracking-web-browse-actions" class="cell markdown">
+<h1>MultiOn Tracking Web Browse Actions</h1>
+<p><img src="https://github.com/AgentOps-AI/agentops/blob/b4aac2d4b9fb16d6aa0a25aa9018210a94f1bef2/docs/logo/multion_integration.png?raw=true" width="250px" style="max-width: 100%; height: auto;"/></p>
+<p>Agents using MultiOn can launch and control remote or local web
+browsers to perform actions and retrieve context using natural language
+commands. With AgentOps, MultiOn evens such as browse, retrieve, and
+step are automatically tracked.</p>
+<p><img
+src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/agentops-multion-browse.gif?raw=true"
+alt="AgentOps MultiOn Browse" /></p>
+<p>Furthermore, events and LLM calls in your Python program will be
+tracked as well.</p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Install dependencies</span></span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U multion</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U agentops</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U openai</span></code></pre></div>
+</div>
+<section id="tracking-multion-events-with-agentops"
+class="cell markdown">
+<h3>Tracking MultiOn events with AgentOps</h3>
+<p>When an <code>agentops_api_key</code> is provided, MultiOn will
+automatically start an AgentOps session and record events.</p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Set your API keys</span></span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;MULTION_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;multion_key&quot;</span></span>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;agentops_key&quot;</span></span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.client <span class="im">import</span> MultiOn</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.core.request_options <span class="im">import</span> RequestOptions</span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> openai</span>
+<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a>multion <span class="op">=</span> MultiOn(</span>
+<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;MULTION_API_KEY&quot;</span>),</span>
+<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a> agentops_api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>),</span>
+<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a>cmd <span class="op">=</span> <span class="st">&quot;what three things do i get with agentops&quot;</span></span>
+<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a>request_options <span class="op">=</span> RequestOptions(</span>
+<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a> timeout_in_seconds<span class="op">=</span><span class="dv">60</span>, max_retries<span class="op">=</span><span class="dv">4</span>, additional_headers<span class="op">=</span>{<span class="st">&quot;test&quot;</span>: <span class="st">&quot;ing&quot;</span>}</span>
+<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-15"><a href="#cb3-15" aria-hidden="true" tabindex="-1"></a>browse_response <span class="op">=</span> multion.browse(</span>
+<span id="cb3-16"><a href="#cb3-16" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span><span class="st">&quot;what three things do i get with agentops&quot;</span>,</span>
+<span id="cb3-17"><a href="#cb3-17" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span><span class="st">&quot;https://www.agentops.ai/&quot;</span>,</span>
+<span id="cb3-18"><a href="#cb3-18" aria-hidden="true" tabindex="-1"></a> max_steps<span class="op">=</span><span class="dv">4</span>,</span>
+<span id="cb3-19"><a href="#cb3-19" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb3-20"><a href="#cb3-20" aria-hidden="true" tabindex="-1"></a> request_options<span class="op">=</span>request_options,</span>
+<span id="cb3-21"><a href="#cb3-21" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-22"><a href="#cb3-22" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-23"><a href="#cb3-23" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(browse_response.message)</span></code></pre></div>
+</div>
+<section id="linking-multion-events-to-an-existing-agentops-session"
+class="cell markdown">
+<h3>Linking MultiOn events to an existing AgentOps session</h3>
+<p>When running <code>agentops.init()</code>, be sure to set
+<code>auto_start_session=False</code>. MultiOn will automatically launch
+AgentOps sessions by default, but by setting auto start to false, you
+can configure your AgentOps client independently.</p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>agentops.init(auto_start_session<span class="op">=</span><span class="va">False</span>, tags<span class="op">=</span>[<span class="st">&quot;MultiOn browse example&quot;</span>])</span></code></pre></div>
+</div>
+<div class="cell markdown">
+<p>Now, we can launch a MultiOn browse event. This event will
+automatically get added to your AgentOps session.</p>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>multion <span class="op">=</span> MultiOn(</span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;MULTION_API_KEY&quot;</span>),</span>
+<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> agentops_api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>),</span>
+<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a>cmd <span class="op">=</span> <span class="st">&quot;what three things do i get with agentops&quot;</span></span>
+<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>request_options <span class="op">=</span> RequestOptions(</span>
+<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> timeout_in_seconds<span class="op">=</span><span class="dv">60</span>, max_retries<span class="op">=</span><span class="dv">4</span>, additional_headers<span class="op">=</span>{<span class="st">&quot;test&quot;</span>: <span class="st">&quot;ing&quot;</span>}</span>
+<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a>browse_response <span class="op">=</span> multion.browse(</span>
+<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span><span class="st">&quot;what three things do i get with agentops&quot;</span>,</span>
+<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span><span class="st">&quot;https://www.agentops.ai/&quot;</span>,</span>
+<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a> max_steps<span class="op">=</span><span class="dv">4</span>,</span>
+<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a> request_options<span class="op">=</span>request_options,</span>
+<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(browse_response.message)</span></code></pre></div>
+</div>
+<div class="cell markdown">
+<p>Let's use OpenAI to summarize our output</p>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb6"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>messages <span class="op">=</span> [</span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> {</span>
+<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>,</span>
+<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;content&quot;</span>: <span class="ss">f&quot;Format this data as a markdown table: </span><span class="sc">{</span>browse_response<span class="sc">.</span>message<span class="sc">}</span><span class="ss">&quot;</span>,</span>
+<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> }</span>
+<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a>]</span>
+<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a>client <span class="op">=</span> openai.OpenAI()</span>
+<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a>response <span class="op">=</span> client.chat.completions.create(messages<span class="op">=</span>messages, model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>)</span>
+<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(response.choices[<span class="dv">0</span>].message.content)</span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb7"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># End session to see your dashboard</span></span>
+<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+</div>
+<section id="check-your-session" class="cell markdown">
+<h2>Check your session</h2>
+<p>Check your session on <a href="https://app.agentops.ai">AgentOps</a>.
+This session should include the MultiOn browse action and the OpenAI
+call.</p>
+<p><img src="image.png" alt="image.png" /></p>
+</section>
+<div class="cell markdown">
+
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/multion/Sample_browsing_agent.html b/docs/v1/examples/notebooks/multion/Sample_browsing_agent.html
new file mode 100644
index 00000000..ba664131
--- /dev/null
+++ b/docs/v1/examples/notebooks/multion/Sample_browsing_agent.html
@@ -0,0 +1,193 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>Sample_browsing_agent</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div class="cell markdown">
+<h1>MultiOn Tracking Web Browse Actions</h1>
+<p><img src="https://github.com/AgentOps-AI/agentops/blob/b4aac2d4b9fb16d6aa0a25aa9018210a94f1bef2/docs/logo/multion_integration.png?raw=true" width="250px" style="max-width: 100%; height: auto;"/></p>
+<p>Agents using MultiOn can launch and control remote or local web
+browsers to perform actions and retrieve context using natural language
+commands. With AgentOps, MultiOn evens such as browse, retrieve, and
+step are automatically tracked.</p>
+<p><img
+src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/agentops-multion-browse.gif?raw=true"
+alt="AgentOps MultiOn Browse" /></p>
+<p>Furthermore, events and LLM calls in your Python program will be
+tracked as well.</p>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Install dependencies</span></span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U multion</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U agentops</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U openai</span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.client <span class="im">import</span> MultiOn</span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.core.request_options <span class="im">import</span> RequestOptions</span>
+<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> openai</span>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Set your API keys</span></span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;MULTION_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;multion_key&quot;</span></span>
+<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;agentops_key&quot;</span></span></code></pre></div>
+</div>
+<section id="create-an-agentops-session" class="cell markdown">
+<h3>Create an AgentOps session</h3>
+<p>When running <code>agentops.init()</code>, be sure to set
+<code>auto_start_session=False</code>. MultiOn will automatically launch
+AgentOps sessions by default, but by setting auto start to false, you
+can configure your AgentOps client independently.</p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>agentops.init(auto_start_session<span class="op">=</span><span class="va">False</span>, tags<span class="op">=</span>[<span class="st">&quot;MultiOn browse example&quot;</span>])</span></code></pre></div>
+</div>
+<div class="cell markdown">
+<p>Now, we can launch a MultiOn browse event. This event will
+automatically get added to your AgentOps session.</p>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>multion <span class="op">=</span> MultiOn(</span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;MULTION_API_KEY&quot;</span>),</span>
+<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> agentops_api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>),</span>
+<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a>cmd <span class="op">=</span> <span class="st">&quot;what three things do i get with agentops&quot;</span></span>
+<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>request_options <span class="op">=</span> RequestOptions(</span>
+<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> timeout_in_seconds<span class="op">=</span><span class="dv">60</span>, max_retries<span class="op">=</span><span class="dv">4</span>, additional_headers<span class="op">=</span>{<span class="st">&quot;test&quot;</span>: <span class="st">&quot;ing&quot;</span>}</span>
+<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a>browse_response <span class="op">=</span> multion.browse(</span>
+<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span><span class="st">&quot;what three things do i get with agentops&quot;</span>,</span>
+<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span><span class="st">&quot;https://www.agentops.ai/&quot;</span>,</span>
+<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a> max_steps<span class="op">=</span><span class="dv">4</span>,</span>
+<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a> request_options<span class="op">=</span>request_options,</span>
+<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(browse_response.message)</span></code></pre></div>
+</div>
+<div class="cell markdown">
+<p>Let's use OpenAI to summarize our output</p>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb6"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>messages <span class="op">=</span> [</span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> {</span>
+<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>,</span>
+<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;content&quot;</span>: <span class="ss">f&quot;Format this data as a markdown table: </span><span class="sc">{</span>browse_response<span class="sc">.</span>message<span class="sc">}</span><span class="ss">&quot;</span>,</span>
+<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> }</span>
+<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a>]</span>
+<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a>client <span class="op">=</span> openai.OpenAI()</span>
+<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a>response <span class="op">=</span> client.chat.completions.create(messages<span class="op">=</span>messages, model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>)</span>
+<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(response.choices[<span class="dv">0</span>].message.content)</span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb7"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># End session to see your dashboard</span></span>
+<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+</div>
+<section id="check-your-session" class="cell markdown">
+<h2>Check your session</h2>
+<p>Check your session on <a href="https://app.agentops.ai">AgentOps</a>.
+This session should include the MultiOn browse action and the OpenAI
+call.</p>
+</section>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/multion/Step_by_step_web_browsing.html b/docs/v1/examples/notebooks/multion/Step_by_step_web_browsing.html
new file mode 100644
index 00000000..0b64d5ae
--- /dev/null
+++ b/docs/v1/examples/notebooks/multion/Step_by_step_web_browsing.html
@@ -0,0 +1,260 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>Step_by_step_web_browsing</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<section id="multion-step-tracing" class="cell markdown">
+<h1>MultiOn Step Tracing</h1>
+<p><img src="https://github.com/AgentOps-AI/agentops/blob/b4aac2d4b9fb16d6aa0a25aa9018210a94f1bef2/docs/logo/multion_integration.png?raw=true" width="250px" style="max-width: 100%; height: auto;"/></p>
+<p>With AgentOps, agent actions as well as MultiOn browse events will
+get tracked. MultiOn browse events automatically trace screenshots as
+well.</p>
+<p>This example shows how to use MultiOn's session creator to launch a
+self-directed browser agent that accomplishes a specified objective
+using Step Mode. MultiOn agents can either accomplish tasks fully
+autonomously or managed one step at a time. In this example, we will
+launch a MutliOn agent and manage each individual step.</p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U multion</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U agentops</span></code></pre></div>
+</div>
+<section id="session-streaming" class="cell markdown">
+<h1>Session streaming</h1>
+<p>In this example, we'll use MultiOn to stream individual steps to
+accomplish a task. To track your runs in the AgentOps dashboard, specify
+an <code>agentops_api_key</code> when initializing
+<code>MultiOn()</code></p>
+<p>You can run MultiOn without running <code>agentops.init()</code>.
+However, you will only see events from MultiOn, and not any from your
+own agent.</p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Set your API keys</span></span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;MULTION_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;multion_key&quot;</span></span>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;agentops_key&quot;</span></span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> multion</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.client <span class="im">import</span> MultiOn</span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.sessions.types.sessions_step_request_browser_params <span class="im">import</span> (</span>
+<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> SessionsStepRequestBrowserParams,</span>
+<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.core.request_options <span class="im">import</span> RequestOptions</span>
+<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a>multion <span class="op">=</span> MultiOn(</span>
+<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;MULTION_API_KEY&quot;</span>),</span>
+<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a> agentops_api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>),</span>
+<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a>url <span class="op">=</span> <span class="st">&quot;https://www.agentops.ai/&quot;</span></span>
+<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a>cmd <span class="op">=</span> <span class="st">&quot;what three things do i get with agentops&quot;</span></span>
+<span id="cb3-15"><a href="#cb3-15" aria-hidden="true" tabindex="-1"></a>create_session_response <span class="op">=</span> multion.sessions.create(url<span class="op">=</span>url)</span>
+<span id="cb3-16"><a href="#cb3-16" aria-hidden="true" tabindex="-1"></a>session_id <span class="op">=</span> create_session_response.session_id</span>
+<span id="cb3-17"><a href="#cb3-17" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(create_session_response.message)</span>
+<span id="cb3-18"><a href="#cb3-18" aria-hidden="true" tabindex="-1"></a>browser_params <span class="op">=</span> SessionsStepRequestBrowserParams(height<span class="op">=</span><span class="fl">1.1</span>, width<span class="op">=</span><span class="fl">1.1</span>)</span>
+<span id="cb3-19"><a href="#cb3-19" aria-hidden="true" tabindex="-1"></a>request_options <span class="op">=</span> RequestOptions(</span>
+<span id="cb3-20"><a href="#cb3-20" aria-hidden="true" tabindex="-1"></a> timeout_in_seconds<span class="op">=</span><span class="dv">60</span>, max_retries<span class="op">=</span><span class="dv">2</span>, additional_headers<span class="op">=</span>{<span class="st">&quot;test&quot;</span>: <span class="st">&quot;ing&quot;</span>}</span>
+<span id="cb3-21"><a href="#cb3-21" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-22"><a href="#cb3-22" aria-hidden="true" tabindex="-1"></a>step_session_response <span class="op">=</span> multion.sessions.step(</span>
+<span id="cb3-23"><a href="#cb3-23" aria-hidden="true" tabindex="-1"></a> session_id<span class="op">=</span>session_id,</span>
+<span id="cb3-24"><a href="#cb3-24" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span>cmd,</span>
+<span id="cb3-25"><a href="#cb3-25" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span>url,</span>
+<span id="cb3-26"><a href="#cb3-26" aria-hidden="true" tabindex="-1"></a> browser_params<span class="op">=</span>browser_params,</span>
+<span id="cb3-27"><a href="#cb3-27" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb3-28"><a href="#cb3-28" aria-hidden="true" tabindex="-1"></a> request_options<span class="op">=</span>request_options,</span>
+<span id="cb3-29"><a href="#cb3-29" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-30"><a href="#cb3-30" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(step_session_response.message)</span>
+<span id="cb3-31"><a href="#cb3-31" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-32"><a href="#cb3-32" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> step_session_response.status <span class="op">==</span> <span class="st">&quot;CONTINUE&quot;</span>:</span>
+<span id="cb3-33"><a href="#cb3-33" aria-hidden="true" tabindex="-1"></a> step_session_response <span class="op">=</span> multion.sessions.step(</span>
+<span id="cb3-34"><a href="#cb3-34" aria-hidden="true" tabindex="-1"></a> session_id<span class="op">=</span>session_id,</span>
+<span id="cb3-35"><a href="#cb3-35" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span>cmd,</span>
+<span id="cb3-36"><a href="#cb3-36" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span>url,</span>
+<span id="cb3-37"><a href="#cb3-37" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb3-38"><a href="#cb3-38" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb3-39"><a href="#cb3-39" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(step_session_response.message)</span>
+<span id="cb3-40"><a href="#cb3-40" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-41"><a href="#cb3-41" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> step_session_response.status <span class="op">==</span> <span class="st">&quot;DONE&quot;</span>:</span>
+<span id="cb3-42"><a href="#cb3-42" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&quot;task completed&quot;</span>)</span>
+<span id="cb3-43"><a href="#cb3-43" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-44"><a href="#cb3-44" aria-hidden="true" tabindex="-1"></a>get_screenshot <span class="op">=</span> multion.sessions.screenshot(session_id<span class="op">=</span>session_id)</span>
+<span id="cb3-45"><a href="#cb3-45" aria-hidden="true" tabindex="-1"></a>close_session_response <span class="op">=</span> multion.sessions.close(session_id<span class="op">=</span>session_id)</span></code></pre></div>
+</div>
+<section id="step-stream" class="cell markdown">
+<h1>Step Stream</h1>
+<p>Step stream is just like step, but it streams responses in the same
+way a streamed LLM response is received. Instead of waiting for the
+entire step to complete, MultiOn will return work in progress. To track
+your runs in the AgentOps dashboard, specify an
+<code>agentops_api_key</code> when initializing
+<code>MultiOn()</code></p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;MULTION_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;e8cbbd0f8fa042f49f267a44bf97425c&quot;</span></span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;a640373b-30ae-4655-a1f3-5caa882a8721&quot;</span></span></code></pre></div>
+</div>
+<div class="cell code" data-scrolled="true">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> multion</span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.client <span class="im">import</span> MultiOn</span>
+<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.sessions.types.sessions_step_stream_request_browser_params <span class="im">import</span> (</span>
+<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> SessionsStepStreamRequestBrowserParams,</span>
+<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.core.request_options <span class="im">import</span> RequestOptions</span>
+<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a>multion <span class="op">=</span> MultiOn(</span>
+<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;MULTION_API_KEY&quot;</span>),</span>
+<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a> agentops_api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>),</span>
+<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a>url <span class="op">=</span> <span class="st">&quot;https://www.agentops.ai/&quot;</span></span>
+<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a>cmd <span class="op">=</span> <span class="st">&quot;what three things do i get with agentops&quot;</span></span>
+<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a>create_session_response <span class="op">=</span> multion.sessions.create(url<span class="op">=</span>url)</span>
+<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a>session_id <span class="op">=</span> create_session_response.session_id</span>
+<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(create_session_response.message)</span>
+<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a>browser_params <span class="op">=</span> SessionsStepStreamRequestBrowserParams(height<span class="op">=</span><span class="fl">1.1</span>, width<span class="op">=</span><span class="fl">1.1</span>)</span>
+<span id="cb5-20"><a href="#cb5-20" aria-hidden="true" tabindex="-1"></a>request_options <span class="op">=</span> RequestOptions(</span>
+<span id="cb5-21"><a href="#cb5-21" aria-hidden="true" tabindex="-1"></a> timeout_in_seconds<span class="op">=</span><span class="dv">60</span>, max_retries<span class="op">=</span><span class="dv">2</span>, additional_headers<span class="op">=</span>{<span class="st">&quot;test&quot;</span>: <span class="st">&quot;ing&quot;</span>}</span>
+<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-23"><a href="#cb5-23" aria-hidden="true" tabindex="-1"></a>step_session_response <span class="op">=</span> multion.sessions.step_stream(</span>
+<span id="cb5-24"><a href="#cb5-24" aria-hidden="true" tabindex="-1"></a> session_id<span class="op">=</span>session_id,</span>
+<span id="cb5-25"><a href="#cb5-25" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span>cmd,</span>
+<span id="cb5-26"><a href="#cb5-26" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span>url,</span>
+<span id="cb5-27"><a href="#cb5-27" aria-hidden="true" tabindex="-1"></a> browser_params<span class="op">=</span>browser_params,</span>
+<span id="cb5-28"><a href="#cb5-28" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb5-29"><a href="#cb5-29" aria-hidden="true" tabindex="-1"></a> request_options<span class="op">=</span>request_options,</span>
+<span id="cb5-30"><a href="#cb5-30" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb5-31"><a href="#cb5-31" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-32"><a href="#cb5-32" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> chunk <span class="kw">in</span> step_session_response:</span>
+<span id="cb5-33"><a href="#cb5-33" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> chunk.<span class="bu">type</span> <span class="op">==</span> <span class="st">&quot;final_event&quot;</span>:</span>
+<span id="cb5-34"><a href="#cb5-34" aria-hidden="true" tabindex="-1"></a> <span class="cf">break</span></span>
+<span id="cb5-35"><a href="#cb5-35" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(chunk.delta[<span class="st">&quot;content&quot;</span>])</span>
+<span id="cb5-36"><a href="#cb5-36" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-37"><a href="#cb5-37" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> chunk.delta[<span class="st">&quot;status&quot;</span>] <span class="op">==</span> <span class="st">&quot;CONTINUE&quot;</span>:</span>
+<span id="cb5-38"><a href="#cb5-38" aria-hidden="true" tabindex="-1"></a> step_session_response <span class="op">=</span> multion.sessions.step_stream(</span>
+<span id="cb5-39"><a href="#cb5-39" aria-hidden="true" tabindex="-1"></a> session_id<span class="op">=</span>session_id,</span>
+<span id="cb5-40"><a href="#cb5-40" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span>cmd,</span>
+<span id="cb5-41"><a href="#cb5-41" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span>url,</span>
+<span id="cb5-42"><a href="#cb5-42" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb5-43"><a href="#cb5-43" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb5-44"><a href="#cb5-44" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> chunk <span class="kw">in</span> step_session_response:</span>
+<span id="cb5-45"><a href="#cb5-45" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> chunk.<span class="bu">type</span> <span class="op">==</span> <span class="st">&quot;final_event&quot;</span>:</span>
+<span id="cb5-46"><a href="#cb5-46" aria-hidden="true" tabindex="-1"></a> <span class="cf">break</span></span>
+<span id="cb5-47"><a href="#cb5-47" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(chunk.delta[<span class="st">&quot;content&quot;</span>])</span>
+<span id="cb5-48"><a href="#cb5-48" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-49"><a href="#cb5-49" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> chunk.delta[<span class="st">&quot;status&quot;</span>] <span class="op">==</span> <span class="st">&quot;DONE&quot;</span>:</span>
+<span id="cb5-50"><a href="#cb5-50" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&quot;task completed&quot;</span>)</span>
+<span id="cb5-51"><a href="#cb5-51" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-52"><a href="#cb5-52" aria-hidden="true" tabindex="-1"></a>get_screenshot <span class="op">=</span> multion.sessions.screenshot(session_id<span class="op">=</span>session_id)</span>
+<span id="cb5-53"><a href="#cb5-53" aria-hidden="true" tabindex="-1"></a>close_session_response <span class="op">=</span> multion.sessions.close(session_id<span class="op">=</span>session_id)</span></code></pre></div>
+</div>
+<section id="check-your-session" class="cell markdown">
+<h2>Check your session</h2>
+<p>Check your session on <a
+href="https://app.agentops.ai">AgentOps</a></p>
+<p><img
+src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/agentops-multion-step.gif?raw=true"
+alt="AgentOps MultiOn Step" /></p>
+<p><img
+src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/agentops-session-overview.png?raw=true"
+alt="AgentOps Session Overview" /></p>
+</section>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/multion/Webpage_data_retrieval.html b/docs/v1/examples/notebooks/multion/Webpage_data_retrieval.html
new file mode 100644
index 00000000..ea5f8f99
--- /dev/null
+++ b/docs/v1/examples/notebooks/multion/Webpage_data_retrieval.html
@@ -0,0 +1,158 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>Webpage_data_retrieval</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<section id="multion-autonomous-session-tracing" class="cell markdown">
+<h1>MultiOn Autonomous Session Tracing</h1>
+<p><img src="https://github.com/AgentOps-AI/agentops/blob/b4aac2d4b9fb16d6aa0a25aa9018210a94f1bef2/docs/logo/multion_integration.png?raw=true" width="250px" style="max-width: 100%; height: auto;"/></p>
+<p>With AgentOps, agent actions as well as MultiOn retrieve events will
+get tracked. MultiOn browse events automatically trace screenshots as
+well.</p>
+<p>This example shows how to use MultiOn's session creator to launch a
+self-directed browser agent that accomplishes a specified objective.</p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U multion</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="op">%</span>pip install <span class="op">-</span>U agentops</span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Set your API keys</span></span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;MULTION_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;multion_key&quot;</span></span>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>os.environ[<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>] <span class="op">=</span> <span class="st">&quot;agentops_key&quot;</span></span></code></pre></div>
+</div>
+<div class="cell code">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> multion</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> multion.client <span class="im">import</span> MultiOn</span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>multion <span class="op">=</span> MultiOn(</span>
+<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;MULTION_API_KEY&quot;</span>),</span>
+<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> agentops_api_key<span class="op">=</span>os.environ.get(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>),</span>
+<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a>cmd <span class="op">=</span> <span class="st">&quot;what three things do i get with agentops&quot;</span></span>
+<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a>url <span class="op">=</span> <span class="st">&quot;https://www.agentops.ai/&quot;</span></span>
+<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a>retrieve_response <span class="op">=</span> multion.retrieve(</span>
+<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span>cmd, url<span class="op">=</span>url, fields<span class="op">=</span>[<span class="st">&quot;price&quot;</span>], include_screenshot<span class="op">=</span><span class="va">True</span></span>
+<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb3-15"><a href="#cb3-15" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(retrieve_response.message)</span>
+<span id="cb3-16"><a href="#cb3-16" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-17"><a href="#cb3-17" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> retrieve_response.status <span class="op">==</span> <span class="st">&quot;CONTINUE&quot;</span>:</span>
+<span id="cb3-18"><a href="#cb3-18" aria-hidden="true" tabindex="-1"></a> retrieve_response <span class="op">=</span> multion.retrieve(</span>
+<span id="cb3-19"><a href="#cb3-19" aria-hidden="true" tabindex="-1"></a> cmd<span class="op">=</span>cmd,</span>
+<span id="cb3-20"><a href="#cb3-20" aria-hidden="true" tabindex="-1"></a> url<span class="op">=</span>url,</span>
+<span id="cb3-21"><a href="#cb3-21" aria-hidden="true" tabindex="-1"></a> fields<span class="op">=</span>[<span class="st">&quot;price&quot;</span>],</span>
+<span id="cb3-22"><a href="#cb3-22" aria-hidden="true" tabindex="-1"></a> include_screenshot<span class="op">=</span><span class="va">True</span>,</span>
+<span id="cb3-23"><a href="#cb3-23" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb3-24"><a href="#cb3-24" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(retrieve_response.message)</span>
+<span id="cb3-25"><a href="#cb3-25" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-26"><a href="#cb3-26" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> retrieve_response.status <span class="op">==</span> <span class="st">&quot;DONE&quot;</span>:</span>
+<span id="cb3-27"><a href="#cb3-27" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&quot;task completed&quot;</span>)</span></code></pre></div>
+</div>
+<section id="check-your-session" class="cell markdown">
+<h2>Check your session</h2>
+<p>Check your session on <a
+href="https://app.agentops.ai">AgentOps</a></p>
+<p><img
+src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/agentops-multion-retrieve.gif?raw=true"
+alt="AgentOps Multion Retrieve" /></p>
+</section>
+<div class="cell code">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"></code></pre></div>
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/openai-gpt.html b/docs/v1/examples/notebooks/openai-gpt.html
new file mode 100644
index 00000000..eb04650a
--- /dev/null
+++ b/docs/v1/examples/notebooks/openai-gpt.html
@@ -0,0 +1,202 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>openai-gpt</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div id="212799f5255f3513" class="cell markdown" data-collapsed="false">
+<h1 id="agentops-basic-monitoring">AgentOps Basic Monitoring</h1>
+<p>This is an example of how to use the AgentOps library for basic Agent
+monitoring with OpenAI's GPT</p>
+</div>
+<div id="c51dcbda80eb8c53" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> openai <span class="im">import</span> OpenAI</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> dotenv <span class="im">import</span> load_dotenv</span></code></pre></div>
+</div>
+<div id="33bb35b82e9a8f71" class="cell markdown" data-collapsed="false">
+<p>Next, we'll grab our two API keys. You can use dotenv like below or
+however else you like to load environment variables</p>
+</div>
+<div id="cbc5d13679e269dc" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>load_dotenv()</span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>OPENAI_API_KEY <span class="op">=</span> os.getenv(<span class="st">&quot;OPENAI_API_KEY&quot;</span>) <span class="kw">or</span> <span class="st">&quot;&lt;your_openai_key&gt;&quot;</span></span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>AGENTOPS_API_KEY <span class="op">=</span> os.getenv(<span class="st">&quot;AGENTOPS_API_KEY&quot;</span>) <span class="kw">or</span> <span class="st">&quot;&lt;your_agentops_key&gt;&quot;</span></span></code></pre></div>
+</div>
+<div id="82fdff21ff00ef37" class="cell markdown" data-collapsed="false">
+<p>The AgentOps library is designed to be a plug-and-play replacement
+for the OpenAI Client, maximizing use with minimal install effort.</p>
+</div>
+<div id="5d424a02e30ce7f4" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>openai <span class="op">=</span> OpenAI(api_key<span class="op">=</span>OPENAI_API_KEY)</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>agentops.init(AGENTOPS_API_KEY, tags<span class="op">=</span>[<span class="st">&quot;openai-gpt-notebook&quot;</span>])</span></code></pre></div>
+</div>
+<div id="c77f4f920c07e3e6" class="cell markdown" data-collapsed="false">
+<p>Now just use OpenAI as you would normally!</p>
+</div>
+<div id="ca7011cf1ba076c9" class="cell markdown" data-collapsed="false">
+<h2 id="single-session-with-chatcompletion">Single Session with
+ChatCompletion</h2>
+</div>
+<div id="2704d6d625efa77f" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>message <span class="op">=</span> ({<span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>, <span class="st">&quot;content&quot;</span>: <span class="st">&quot;Write a 12 word poem about secret agents.&quot;</span>},)</span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>res <span class="op">=</span> openai.chat.completions.create(</span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>, messages<span class="op">=</span>message, temperature<span class="op">=</span><span class="fl">0.5</span>, stream<span class="op">=</span><span class="va">True</span></span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="ce4965fc1614b5fe" class="cell markdown" data-collapsed="false">
+<p>Make sure to end your session with a <code>Result</code>
+(Success|Fail|Indeterminate) for better tracking</p>
+</div>
+<div id="537abd77cd0e0d25" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+</div>
+<div id="dd69580627842705" class="cell markdown" data-collapsed="false">
+<p>Now if you check the AgentOps dashboard, you should see information
+related to this run!</p>
+</div>
+<div id="b824bb935c7b7f80" class="cell markdown" data-collapsed="false">
+<h1 id="events">Events</h1>
+<p>Additionally, you can track custom events via AgentOps. Let's start a
+new session and record some events</p>
+</div>
+<div id="544c8f1bdb8c6e4b" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb6"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Create new session</span></span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>agentops.start_session(tags<span class="op">=</span>[<span class="st">&quot;openai-gpt-notebook-events&quot;</span>])</span></code></pre></div>
+</div>
+<div id="e94f1b56" class="cell markdown">
+<p>The easiest way to record actions is through the use of AgentOp's
+decorators</p>
+</div>
+<div id="b45754a57148eed1" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb7"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops <span class="im">import</span> record_function</span>
+<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="at">@record_function</span>(<span class="st">&quot;add numbers&quot;</span>)</span>
+<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> add(x, y):</span>
+<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> x <span class="op">+</span> y</span>
+<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a>add(<span class="dv">2</span>, <span class="dv">4</span>)</span></code></pre></div>
+</div>
+<div id="1e3cc512" class="cell markdown">
+<p>We can also manually craft an event exactly the way we want</p>
+</div>
+<div id="2ac84c35" class="cell code">
+<div class="sourceCode" id="cb8"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops <span class="im">import</span> ActionEvent</span>
+<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a>message <span class="op">=</span> ({<span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>, <span class="st">&quot;content&quot;</span>: <span class="st">&quot;Hello&quot;</span>},)</span>
+<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a>response <span class="op">=</span> openai.chat.completions.create(</span>
+<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>, messages<span class="op">=</span>message, temperature<span class="op">=</span><span class="fl">0.5</span></span>
+<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a>)</span>
+<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="st">&quot;hello&quot;</span> <span class="kw">in</span> <span class="bu">str</span>(response.choices[<span class="dv">0</span>].message.content).lower():</span>
+<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a> agentops.record(</span>
+<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a> ActionEvent(</span>
+<span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a> action_type<span class="op">=</span><span class="st">&quot;Agent says hello&quot;</span>,</span>
+<span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a> params<span class="op">=</span><span class="bu">str</span>(message),</span>
+<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a> returns<span class="op">=</span><span class="bu">str</span>(response.choices[<span class="dv">0</span>].message.content),</span>
+<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb8-15"><a href="#cb8-15" aria-hidden="true" tabindex="-1"></a> )</span></code></pre></div>
+</div>
+<div id="4ca2b49fc06adddb" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb9"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/notebooks/recording-events.html b/docs/v1/examples/notebooks/recording-events.html
new file mode 100644
index 00000000..fe16e308
--- /dev/null
+++ b/docs/v1/examples/notebooks/recording-events.html
@@ -0,0 +1,196 @@
+<!-- This file was generated by Pandoc -->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <title>recording-events</title>
+ <style>
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
+ div.column{flex: auto; overflow-x: auto;}
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ /* The extra [class] is a hack that increases specificity enough to
+ override a similar rule in reveal.js */
+ ul.task-list[class]{list-style: none;}
+ ul.task-list li input[type="checkbox"] {
+ font-size: inherit;
+ width: 0.8em;
+ margin: 0 0.8em 0.2em -1.6em;
+ vertical-align: middle;
+ }
+ .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+ /* CSS for syntax highlighting */
+ pre > code.sourceCode { white-space: pre; position: relative; }
+ pre > code.sourceCode > span { line-height: 1.25; }
+ pre > code.sourceCode > span:empty { height: 1.2em; }
+ .sourceCode { overflow: visible; }
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
+ div.sourceCode { margin: 1em 0; }
+ pre.sourceCode { margin: 0; }
+ @media screen {
+ div.sourceCode { overflow: auto; }
+ }
+ @media print {
+ pre > code.sourceCode { white-space: pre-wrap; }
+ pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+ }
+ pre.numberSource code
+ { counter-reset: source-line 0; }
+ pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+ pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+ div.sourceCode
+ { }
+ @media screen {
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+ }
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { color: #008000; } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { color: #008000; font-weight: bold; } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="https://app.agentops.ai/notebook_styles.css" />
+</head>
+<body>
+<div id="dc8cfd2cfa8a594b" class="cell markdown" data-collapsed="false">
+<h1 id="recording-events">Recording Events</h1>
+<p>AgentOps has a number of different <a
+href="https://docs.agentops.ai/v1/details/events">Event Types</a></p>
+<p>AgentOps automatically instruments your LLM Calls from OpenAI,
+LiteLLM, and Cohere. Just make sure their SDKs are imported before
+initializing AgentOps like we see below</p>
+</div>
+<div id="168ecd05cc123de0" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb1"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> agentops</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> openai</span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Create new session</span></span>
+<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a>agentops.init()</span>
+<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="co"># Optionally, we can add tags to the session</span></span>
+<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="co"># agentops.init(tags=[&#39;Hello Tracker&#39;])</span></span>
+<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a>message <span class="op">=</span> ({<span class="st">&quot;role&quot;</span>: <span class="st">&quot;user&quot;</span>, <span class="st">&quot;content&quot;</span>: <span class="st">&quot;Hello&quot;</span>},)</span>
+<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a>response <span class="op">=</span> openai.chat.completions.create(</span>
+<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">&quot;gpt-3.5-turbo&quot;</span>, messages<span class="op">=</span>message, temperature<span class="op">=</span><span class="fl">0.5</span></span>
+<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="95a6047d" class="cell markdown">
+<p>Click the AgentOps link above to see your session!</p>
+</div>
+<div id="c6d06ee8c66dad17" class="cell markdown" data-collapsed="false">
+<h2 id="action-event">Action Event</h2>
+<p>AgentOps allows you to record other actions. The easiest way to
+record actions is through the use of AgentOp's decorators</p>
+</div>
+<div id="b460318317adc624" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb2"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops <span class="im">import</span> record_function</span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="at">@record_function</span>(<span class="st">&quot;add numbers&quot;</span>)</span>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> add(x, y):</span>
+<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> x <span class="op">+</span> y</span>
+<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a>add(<span class="dv">2</span>, <span class="dv">4</span>)</span></code></pre></div>
+</div>
+<div id="9068a4cdd328f652" class="cell markdown" data-collapsed="false">
+<p>We can also manually craft an event exactly the way we want by
+creating and recording an <code>ActionEvent</code></p>
+</div>
+<div id="b62ad88921ff26f2" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb3"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops <span class="im">import</span> ActionEvent</span>
+<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>agentops.record(</span>
+<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> ActionEvent(</span>
+<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> action_type<span class="op">=</span><span class="st">&quot;Agent says hello&quot;</span>, params<span class="op">=</span>{<span class="st">&quot;message&quot;</span>: <span class="st">&quot;Hi&quot;</span>}, returns<span class="op">=</span><span class="st">&quot;Hi Back!&quot;</span></span>
+<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> )</span>
+<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a>)</span></code></pre></div>
+</div>
+<div id="f7c947d815f581e7" class="cell markdown" data-collapsed="false">
+<h2 id="tool-event">Tool Event</h2>
+<p>Agents use tools. These tools are useful to track with information
+such as name, end status, runtime, etc. To record tool usage, you can
+create and record a <code>ToolEvent</code> similar to above.</p>
+</div>
+<div id="5d387a071a1c70cf" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb4"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops <span class="im">import</span> ToolEvent, record</span>
+<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> scrape_website(url: <span class="bu">str</span>):</span>
+<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> tool_event <span class="op">=</span> ToolEvent(</span>
+<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> name<span class="op">=</span><span class="st">&quot;scrape_website&quot;</span>, params<span class="op">=</span>{<span class="st">&quot;url&quot;</span>: url}</span>
+<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> ) <span class="co"># the start timestamp is set when the obj is created</span></span>
+<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> result <span class="op">=</span> integration.scrape_website(data) <span class="co"># perform tool logic</span></span>
+<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> tool_event.returns <span class="op">=</span> result</span>
+<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> record(tool_event)</span></code></pre></div>
+</div>
+<div id="968d1503dd0aae9a" class="cell markdown" data-collapsed="false">
+<h2 id="error-events">Error Events</h2>
+<p>Error events can be used alone or in reference to another event. Lets
+add a catch block to the code above</p>
+</div>
+<div id="eb23c1325298e22f" class="cell code" data-collapsed="false">
+<div class="sourceCode" id="cb5"><pre
+class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> agentops <span class="im">import</span> ToolEvent, record, ErrorEvent</span>
+<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> scrape_website(url: <span class="bu">str</span>):</span>
+<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> tool_event <span class="op">=</span> ToolEvent(</span>
+<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> name<span class="op">=</span><span class="st">&quot;scrape_website&quot;</span>, params<span class="op">=</span>{<span class="st">&quot;url&quot;</span>: url}</span>
+<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> ) <span class="co"># the start timestamp is set when the obj is created</span></span>
+<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
+<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a> <span class="dv">1</span> <span class="op">/</span> <span class="dv">0</span> <span class="co"># Ooops! Something went wrong</span></span>
+<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span> <span class="pp">Exception</span> <span class="im">as</span> e:</span>
+<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a> record(ErrorEvent(exception<span class="op">=</span>e, trigger_event<span class="op">=</span>tool_event))</span>
+<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a>scrape_website(<span class="st">&quot;https://app.agentops.ai&quot;</span>)</span>
+<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a>agentops.end_session(<span class="st">&quot;Success&quot;</span>)</span></code></pre></div>
+</div>
+</body>
+</html>
diff --git a/docs/v1/examples/recording_events.mdx b/docs/v1/examples/recording_events.mdx
new file mode 100644
index 00000000..09445438
--- /dev/null
+++ b/docs/v1/examples/recording_events.mdx
@@ -0,0 +1,10 @@
+---
+title: 'Recording Events'
+description: 'How to record events in your session'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/main/examples/recording-events.ipynb'} target={'_blank'}>Github</a>_
+
+<iframe id="iframe" src={'notebooks/recording-events.html'}></iframe>
+
+<script type="module" src="/scripts/full_iframe.js"></script>
diff --git a/docs/v1/examples/simple_agent.mdx b/docs/v1/examples/simple_agent.mdx
new file mode 100644
index 00000000..01d01065
--- /dev/null
+++ b/docs/v1/examples/simple_agent.mdx
@@ -0,0 +1,10 @@
+---
+title: 'Simple Agent'
+description: 'Most basic usage with OpenAI API'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/main/examples/openai-gpt.ipynb'} target={'_blank'}>Github</a>_
+
+<iframe id="iframe" src={'notebooks/openai-gpt.html'}></iframe>
+
+<script type="module" src="/scripts/full_iframe.js"></script>
diff --git a/docs/v1/scripts/full_iframe.js b/docs/v1/scripts/full_iframe.js
new file mode 100644
index 00000000..e08da43f
--- /dev/null
+++ b/docs/v1/scripts/full_iframe.js
@@ -0,0 +1,15 @@
+window.addEventListener('load', function() {
+ let iframes = document.getElementsByTagName('iframe');
+ for (let i = 0; i < iframes.length; ++i) {
+ let iframe = iframes[i];
+ let body = iframe.contentDocument.body;
+
+ iframe.style.height = body.scrollHeight + 100 + 'px';
+ iframe.style.width = '95%';
+ iframe.style.borderRadius = '15px';
+ iframe.style.boxShadow = '0px 2px 15px rgba(0, 0, 0, 0.1)';
+ iframe.style.marginLeft = '15px';
+ iframe.style.padding = '5px';
+ iframe.style.marginBottom = '25px'
+ }
+});
\ No newline at end of file
diff --git a/docs/v1/scripts/github_stars.js b/docs/v1/scripts/github_stars.js
index 6b8e6b5c..05c073a2 100644
--- a/docs/v1/scripts/github_stars.js
+++ b/docs/v1/scripts/github_stars.js
@@ -5,6 +5,7 @@ function updateStars() {
const stars = Math.ceil(data.stargazers_count / 100) * 100 + 100;
setTimeout(() => {
const dataContainer = document.getElementById("stars-text");
+ if (!dataContainer) return
dataContainer.innerHTML = `${stars.toLocaleString()}th`;
}, 50);
})
diff --git a/docs/v1/scripts/scroll-img-fadein-animation.js b/docs/v1/scripts/scroll-img-fadein-animation.js
index 742da7a6..3246a4d3 100644
--- a/docs/v1/scripts/scroll-img-fadein-animation.js
+++ b/docs/v1/scripts/scroll-img-fadein-animation.js
@@ -60,6 +60,7 @@ function typeInTerminalText() {
function addToTerminal(terminalContentDiv, texts) {
let increment = 0;
const interval = setInterval(() => {
+ if (!terminalContentDiv) return
terminalContentDiv.innerHTML += texts[increment];
increment++;
if (increment === texts.length) {
@@ -67,7 +68,7 @@ function typeInTerminalText() {
cursor.classList.remove("off");
setTimeout(() => {
terminalContentDiv.innerHTML = null;
- pythonTerminal.textContent = "";
+ if (pythonTerminal) pythonTerminal.textContent = "";
terminalCommand.textContent = "";
inlineCodeImg.classList.remove("on");
barelySpace.classList.add("off");
@@ -80,6 +81,7 @@ function typeInTerminalText() {
function typewriterEffect(text, target, nextTarget = null) {
let i = 0;
const interval = setInterval(() => {
+ if (!target) return
if (i < text.length) {
target.textContent += text[i];
i++;
@@ -104,11 +106,11 @@ function typeInTerminalText() {
setInterval(() => {
// this is to catch timeout bugginess with Mint
- terminalContentDiv.innerHTML = null;
- pythonTerminal.textContent = "";
- terminalCommand.textContent = "";
- inlineCodeImg.classList.remove("on");
- barelySpace.classList.add("off");
+ if (terminalContentDiv) terminalContentDiv.innerHTML = null;
+ if (pythonTerminal) pythonTerminal.textContent = "";
+ if (terminalCommand) terminalCommand.textContent = "";
+ if (inlineCodeImg) inlineCodeImg.classList.remove("on");
+ if (barelySpace) barelySpace.classList.add("off");
inlineCodeImg.src = imagesSrcs[contentIncrement];
typewriterEffect(textsAndElementTargets[contentIncrement].text, textsAndElementTargets[contentIncrement].target, textsAndElementTargets[contentIncrement].nextTarget);
@@ -260,6 +262,7 @@ function addIntroEventListeners() {
function loadTerminalText() {
setInterval(() => {
const cursor = document.getElementById("cursor");
+ if (!cursor) return
if (cursor.style.opacity === "0") {
cursor.style.opacity = "1";
} else {
diff --git a/docs/v1/scripts/stars.js b/docs/v1/scripts/stars.js
index 6b8e6b5c..05c073a2 100644
--- a/docs/v1/scripts/stars.js
+++ b/docs/v1/scripts/stars.js
@@ -5,6 +5,7 @@ function updateStars() {
const stars = Math.ceil(data.stargazers_count / 100) * 100 + 100;
setTimeout(() => {
const dataContainer = document.getElementById("stars-text");
+ if (!dataContainer) return
dataContainer.innerHTML = `${stars.toLocaleString()}th`;
}, 50);
})