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
Python agentagentopsagents-sdkaianthropicautogencost-estimationcrewaievalsevaluation-metricsgroqlangchainllmmistralollamaopenaiopenai-agents
Rounds up to nearest 100, makes script elegante (#285)
Albert Kim Jrc0b3a79f9a88
diff --git a/docs/images/external/logo/banner-badge-docs-resized-black.png b/docs/images/external/logo/banner-badge-docs-resized-black.pngnew file mode 100644index 00000000..9329af02Binary files /dev/null and b/docs/images/external/logo/banner-badge-docs-resized-black.png differdiff --git a/docs/images/external/logo/banner-badge-docs-resized-white.png b/docs/images/external/logo/banner-badge-docs-resized-white.pngnew file mode 100644index 00000000..8a50d952Binary files /dev/null and b/docs/images/external/logo/banner-badge-docs-resized-white.png differdiff --git a/docs/images/external/logo/banner-badge-docs.png b/docs/images/external/logo/banner-badge-docs.pngindex f1a89ead..84a97ca0 100644Binary files a/docs/images/external/logo/banner-badge-docs.png and b/docs/images/external/logo/banner-badge-docs.png differdiff --git a/docs/mint.json b/docs/mint.jsonindex 622c6eff..eb148b53 100644--- a/docs/mint.json+++ b/docs/mint.json@@ -2,8 +2,8 @@"$schema": "https://mintlify.com/schema.json","name": "AgentOps","logo": {- "dark": "https://raw.githubusercontent.com/AgentOps-AI/agentops/35d5682866921a9e28d8ef66ae3c3b3d92d8fa6b/img/logo.png",- "light": "https://raw.githubusercontent.com/AgentOps-AI/agentops/35d5682866921a9e28d8ef66ae3c3b3d92d8fa6b/img/logo.png"+ "dark": "/images/external/logo/banner-badge-docs-resized-white.png",+ "light": "/images/external/logo/banner-badge-docs-resized-black.png"},"favicon": "/favicon.png","colors": {diff --git a/docs/v1/concepts/core-concepts.mdx b/docs/v1/concepts/core-concepts.mdxindex 31d4bb6c..5272a05c 100644--- a/docs/v1/concepts/core-concepts.mdx+++ b/docs/v1/concepts/core-concepts.mdx@@ -91,3 +91,6 @@ Optionally, agents may also have:### Threads*Details coming soon.*++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/concepts/decorators.mdx b/docs/v1/concepts/decorators.mdxindex ad475993..8722dcd1 100644--- a/docs/v1/concepts/decorators.mdx+++ b/docs/v1/concepts/decorators.mdx@@ -21,3 +21,6 @@ Sometimes your agent system will use functions that are important to track as [`Adding this decorator above any function will allow every instance of that function call to be tracked and displayedin your [Session](v1/concepts/sessions) Drill-Down on the dashboard.++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/concepts/events.mdx b/docs/v1/concepts/events.mdxindex 38d51b79..0400f4f5 100644--- a/docs/v1/concepts/events.mdx+++ b/docs/v1/concepts/events.mdx@@ -105,3 +105,6 @@ def scrape_website(url: str):record(tool_event)```</CodeGroup>++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/concepts/host-env.mdx b/docs/v1/concepts/host-env.mdxindex 6be89111..9b883566 100644--- a/docs/v1/concepts/host-env.mdx+++ b/docs/v1/concepts/host-env.mdx@@ -29,4 +29,7 @@ AgentOps users can opt out of certain environment data collection by setting theAGENTOPS_ENV_DATA_OPT_OUT=True```-For more questions on privacy and data usage, please [send us an email](mailto:[email protected])\ No newline at end of file+For more questions on privacy and data usage, please [send us an email](mailto:[email protected])++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>diff --git a/docs/v1/concepts/sessions.mdx b/docs/v1/concepts/sessions.mdxindex 6f53eac8..c0db77d3 100644--- a/docs/v1/concepts/sessions.mdx+++ b/docs/v1/concepts/sessions.mdx@@ -69,4 +69,7 @@ _More info for the curious_Under the hood, `agentops.init()` sets up a `Client` object with various configuration options like your API key, worker thread optionsfor when to send out batches of events, etc. Whenever you start a new session, these configuration options will automaticallybe applied. You can also apply different configuration options when you start a new session by passing in a-[Configuration](/v1/usage/sdk-reference/#configuration) object.\ No newline at end of file+[Configuration](/v1/usage/sdk-reference/#configuration) object.++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/concepts/tags.mdx b/docs/v1/concepts/tags.mdxindex e3f405a8..751f7ec4 100644--- a/docs/v1/concepts/tags.mdx+++ b/docs/v1/concepts/tags.mdx@@ -50,4 +50,7 @@ agentops.add_tags(['appended tag'])## Session Drill-down1. Click the session selector button2. In the session selector, click "Tags"-3. Choose what tags to search by\ No newline at end of file+3. Choose what tags to search by++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/examples.mdx b/docs/v1/examples.mdxindex 63d9d79f..fa61e84a 100644--- a/docs/v1/examples.mdx+++ b/docs/v1/examples.mdx@@ -41,3 +41,6 @@ mode: "wide"</Card></CardGroup>++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/img/chart-waterfall.png b/docs/v1/img/chart-waterfall.pngnew file mode 100644index 00000000..459163e8Binary files /dev/null and b/docs/v1/img/chart-waterfall.png differdiff --git a/docs/v1/integrations/autogen.mdx b/docs/v1/integrations/autogen.mdxindex 0b7fe745..6d6f2eec 100644--- a/docs/v1/integrations/autogen.mdx+++ b/docs/v1/integrations/autogen.mdx@@ -19,7 +19,7 @@ Autogen has comprehensive [documentation](https://microsoft.github.io/autogen/dopoetry add agentops```</CodeGroup>- <Check>Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">2,000th</span> 😊)</Check>+ <Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">2,000th</span> 😊)</Check></Step><Step title="Install Autogen"><CodeGroup>@@ -80,19 +80,5 @@ Autogen has comprehensive [documentation](https://microsoft.github.io/autogen/do</Step></Steps>-<script>- {window.addEventListener('load', function() {- fetch("https://api.github.com/repos/AgentOps-AI/agentops")- .then((response) => response.json())- .then((data) => {- const stars = Math.ceil(data.stargazers_count / 1000) * 1000;- const dataContainer = document.getElementById("stars-text");- dataContainer.innerHTML = `${stars.toLocaleString()}th`;-- })- .catch((error) => {- console.error("Error:", error);- document.getElementById("stars-text").textContent = 'Error loading data.';- });- })}-</script>\ No newline at end of file+<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/integrations/cohere.mdx b/docs/v1/integrations/cohere.mdxindex 0d417431..87210186 100644--- a/docs/v1/integrations/cohere.mdx+++ b/docs/v1/integrations/cohere.mdx@@ -115,19 +115,5 @@ This is a living integration. Should you need any added functionality message us```</CodeGroup>-<script>- {window.addEventListener('load', function() {- fetch("https://api.github.com/repos/AgentOps-AI/agentops")- .then((response) => response.json())- .then((data) => {- const stars = Math.ceil(data.stargazers_count / 1000) * 1000;- const dataContainer = document.getElementById("stars-text");- dataContainer.innerHTML = `${stars.toLocaleString()}th`;-- })- .catch((error) => {- console.error("Error:", error);- document.getElementById("stars-text").textContent = 'Error loading data.';- });- })}-</script>\ No newline at end of file+<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/integrations/crewai.mdx b/docs/v1/integrations/crewai.mdxindex af6faef2..ae7797b1 100644--- a/docs/v1/integrations/crewai.mdx+++ b/docs/v1/integrations/crewai.mdx@@ -106,19 +106,5 @@ agentops.init(skip_auto_end_session=True)<Card title="Markdown Validator" icon="markdown" href="https://github.com/Agentops-AI/crewAI-examples/tree/main/markdown_validator" /></CardGroup>-<script>- {window.addEventListener('load', function() {- fetch("https://api.github.com/repos/AgentOps-AI/agentops")- .then((response) => response.json())- .then((data) => {- const stars = Math.ceil(data.stargazers_count / 1000) * 1000;- const dataContainer = document.getElementById("stars-text");- dataContainer.innerHTML = `${stars.toLocaleString()}th`;-- })- .catch((error) => {- console.error("Error:", error);- document.getElementById("stars-text").textContent = 'Error loading data.';- });- })}-</script>\ No newline at end of file+<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/integrations/langchain.mdx b/docs/v1/integrations/langchain.mdxindex 6fef2008..b0b5ff1c 100644--- a/docs/v1/integrations/langchain.mdx+++ b/docs/v1/integrations/langchain.mdx@@ -19,9 +19,7 @@ AgentOps works seamlessly with applications built using Langchain.poetry add agentops[langchain]```</CodeGroup>- <Check>- [Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our 2,000th 😊)- </Check>+ <Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">2,000th</span> 😊)</Check></Step><Step title="Set up your import statements">Import the following Langchain and AgentOps dependencies@@ -87,7 +85,7 @@ AgentOps works seamlessly with applications built using Langchain.## Full Examples-<CodeGroup>+<CodeGroup className="adjust-api-key">```python pythonimport osfrom langchain.chat_models import ChatOpenAI@@ -107,4 +105,7 @@ AgentOps works seamlessly with applications built using Langchain.callbacks=[handler], # You must pass in a callback handler to record your agenthandle_parsing_errors=True)```-</CodeGroup>\ No newline at end of file+</CodeGroup>++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/integrations/litellm.mdx b/docs/v1/integrations/litellm.mdxindex 57e3b968..b0efde27 100644--- a/docs/v1/integrations/litellm.mdx+++ b/docs/v1/integrations/litellm.mdx@@ -17,6 +17,8 @@ Call 100+ LLMs using the same Input/Output FormatLiteLLM also supports many [providers](https://docs.litellm.ai/docs/providers)+<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">2,000th</span> 😊)</Check>+## Using AgentOps with LiteLLM### Requires litellm>=1.3.1@@ -38,19 +40,5 @@ response = await litellm.acompletion(model="claude-3", messages=messages)```-<script>- {window.addEventListener('load', function() {- fetch("https://api.github.com/repos/AgentOps-AI/agentops")- .then((response) => response.json())- .then((data) => {- const stars = Math.ceil(data.stargazers_count / 1000) * 1000;- const dataContainer = document.getElementById("stars-text");- dataContainer.innerHTML = `${stars.toLocaleString()}th`;-- })- .catch((error) => {- console.error("Error:", error);- document.getElementById("stars-text").textContent = 'Error loading data.';- });- })}-</script>\ No newline at end of file+<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/introduction.mdx b/docs/v1/introduction.mdxindex f687757f..2a901521 100644--- a/docs/v1/introduction.mdx+++ b/docs/v1/introduction.mdx@@ -67,19 +67,5 @@ View a meta-analysis of all of your sessions in a single view.<img height="200" src="https://github.com/AgentOps-AI/agentops/blob/cf67191f13e0e2a09446a61b7393e1810b3eee95/docs/images/overview.png?raw=true" /></Frame>-<script>- {window.addEventListener('load', function() {- fetch("https://api.github.com/repos/AgentOps-AI/agentops")- .then((response) => response.json())- .then((data) => {- const stars = Math.ceil(data.stargazers_count / 1000) * 1000;- const dataContainer = document.getElementById("stars-text");- dataContainer.innerHTML = `${stars.toLocaleString()}th`;-- })- .catch((error) => {- console.error("Error:", error);- document.getElementById("stars-text").textContent = 'Error loading data.';- });- })}-</script>\ No newline at end of file+<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/quickstart.mdx b/docs/v1/quickstart.mdxindex 5e7c70b6..11c5a236 100644--- a/docs/v1/quickstart.mdx+++ b/docs/v1/quickstart.mdx@@ -154,19 +154,5 @@ agentops.end_session('Success')</Card></CardGroup>-<script>- {window.addEventListener('load', function() {- fetch("https://api.github.com/repos/AgentOps-AI/agentops")- .then((response) => response.json())- .then((data) => {- const stars = Math.ceil(data.stargazers_count / 1000) * 1000;- const dataContainer = document.getElementById("stars-text");- dataContainer.innerHTML = `${stars.toLocaleString()}th`;-- })- .catch((error) => {- console.error("Error:", error);- document.getElementById("stars-text").textContent = 'Error loading data.';- });- })}-</script>\ No newline at end of file+<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/scripts/adjust_api_dynamically.js b/docs/v1/scripts/adjust_api_dynamically.jsnew file mode 100644index 00000000..e69de29bdiff --git a/docs/v1/scripts/stars.js b/docs/v1/scripts/stars.jsnew file mode 100644index 00000000..6b8e6b5c--- /dev/null+++ b/docs/v1/scripts/stars.js@@ -0,0 +1,28 @@+function updateStars() {+ fetch("https://api.github.com/repos/AgentOps-AI/agentops")+ .then((response) => response.json())+ .then((data) => {+ const stars = Math.ceil(data.stargazers_count / 100) * 100 + 100;+ setTimeout(() => {+ const dataContainer = document.getElementById("stars-text");+ dataContainer.innerHTML = `${stars.toLocaleString()}th`;+ }, 50);+ })+ .catch((error) => {+ // console.error("Github Stars pull error:", error);+ });+}++function addNewEventListeners() {+ setTimeout(() => {+ document.querySelectorAll('li, a').forEach(element => {+ element.addEventListener('click', updateStars);+ });+ }, 50);+}++window.addEventListener('load', function() {+ updateStars();+ const observer = new MutationObserver(addNewEventListeners);+ observer.observe(document.body, { childList: true, subtree: true });+});\ No newline at end of filediff --git a/docs/v1/usage/environment-variables.mdx b/docs/v1/usage/environment-variables.mdxindex 1b1e82c7..5b724a0d 100644--- a/docs/v1/usage/environment-variables.mdx+++ b/docs/v1/usage/environment-variables.mdx@@ -24,4 +24,7 @@ AGENTOPS_API_ENDPOINT=https://api.agentops.aiAGENTOPS_LOGGING_LEVEL=INFO# Whether to opt out of recording environment data. <FALSE, TRUE>. Defaults to FALSEAGENTOPS_ENV_DATA_OPT_OUT=FALSE-```\ No newline at end of file+```++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/usage/langchain-callback-handler.mdx b/docs/v1/usage/langchain-callback-handler.mdxindex eeedcf60..2e719d06 100644--- a/docs/v1/usage/langchain-callback-handler.mdx+++ b/docs/v1/usage/langchain-callback-handler.mdx@@ -65,4 +65,7 @@ response = chain.invoke({"animal": "bears"})If your project uses Langchain for Agents, Events and Tools, it may be easier to use the callback Handler for observability.-If your project uses models with Langchain that are not yet supported by AgentOps, they can be supported by the Handler.\ No newline at end of file+If your project uses models with Langchain that are not yet supported by AgentOps, they can be supported by the Handler.++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/usage/recording-events.mdx b/docs/v1/usage/recording-events.mdxindex 3a363964..abbdf8af 100644--- a/docs/v1/usage/recording-events.mdx+++ b/docs/v1/usage/recording-events.mdx@@ -33,3 +33,6 @@ Record any child of the [Event type](/v1/concepts/events) or ErrorEvent.from agentops import record, ActionEventrecord(ActionEvent("event_type1"))```++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/usage/sdk-reference.mdx b/docs/v1/usage/sdk-reference.mdxindex a5982870..6b1e9008 100644--- a/docs/v1/usage/sdk-reference.mdx+++ b/docs/v1/usage/sdk-reference.mdx@@ -151,4 +151,7 @@ Stores the configuration settings for AgentOps clients.[Reference](/v1/usage/langchain-callback-handler)This callback handler is intended to be used as an option in place of AgentOps auto-instrumenting. This is only useful-when using Langchain as your LLM calling library.\ No newline at end of file+when using Langchain as your LLM calling library.++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/usage/tracking-agents.mdx b/docs/v1/usage/tracking-agents.mdxindex 88b0b84a..47485cd3 100644--- a/docs/v1/usage/tracking-agents.mdx+++ b/docs/v1/usage/tracking-agents.mdx@@ -22,3 +22,6 @@ class MyAgent:`trackagent.name` is optional. <br></br>If omitted, agent name defaults to the name of the class (e.g. MyAgent). <br></br>If an event does not originate from a tracked agent, agent name defaults to "Default Agent".++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of filediff --git a/docs/v1/usage/tracking-llm-calls.mdx b/docs/v1/usage/tracking-llm-calls.mdxindex b2e30b05..740a0030 100644--- a/docs/v1/usage/tracking-llm-calls.mdx+++ b/docs/v1/usage/tracking-llm-calls.mdx@@ -26,3 +26,6 @@ To get started, just follow the quick start guide.Get started with AgentOps in under 5 minutes</Card></CardGroup>++<script type="module" src="/scripts/github_stars.js"></script>+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>\ No newline at end of file