Skip to content

Commit 4b59f29

Browse files
Merge branch 'main' into feat/advanced-litellm-callback-handler
2 parents 9a29f5a + b7cbcb7 commit 4b59f29

156 files changed

Lines changed: 16216 additions & 3827 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Compile llms.txt
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'README.md'
9+
- 'CONTRIBUTING.md'
10+
- 'examples/*/README.md'
11+
- 'agentops/*/README.md'
12+
workflow_dispatch:
13+
14+
jobs:
15+
compile-llms-txt:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.11'
26+
27+
- name: Install dependencies
28+
run: |
29+
pip install llms-txt
30+
31+
- name: Compile llms.txt
32+
run: |
33+
cd docs
34+
python compile_llms_txt.py
35+
36+
- name: Commit and push if changed
37+
run: |
38+
git config --local user.email "action@github.com"
39+
git config --local user.name "GitHub Action"
40+
git add llms.txt
41+
git diff --staged --quiet || git commit -m "Auto-update llms.txt from documentation changes"
42+
git push
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Push MCP Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
- 'mcp-v*'
10+
paths:
11+
- 'mcp/**'
12+
- '.github/workflows/docker-mcp-publish.yml'
13+
workflow_dispatch:
14+
15+
jobs:
16+
build-and-push:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Log in to DockerHub
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Extract metadata
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: |
37+
${{ secrets.DOCKERHUB_USERNAME }}/agentops-mcp
38+
tags: |
39+
type=ref,event=branch
40+
type=semver,pattern={{version}}
41+
type=semver,pattern={{major}}.{{minor}}
42+
type=raw,value=latest,enable={{is_default_branch}}
43+
44+
- name: Build and push Docker image
45+
uses: docker/build-push-action@v5
46+
with:
47+
context: ./mcp
48+
file: ./mcp/Dockerfile
49+
push: true
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}
52+
cache-from: type=gha
53+
cache-to: type=gha,mode=max
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
name: Examples Integration Test
2+
3+
# This workflow runs all example scripts to ensure they work correctly
4+
# and that LLM spans are properly tracked in AgentOps using the
5+
# integrated validation functionality.
6+
7+
on:
8+
push:
9+
branches: [ main, develop ]
10+
paths:
11+
- 'examples/**/*.py'
12+
- 'agentops/**'
13+
- '.github/workflows/examples-integration-test.yml'
14+
pull_request:
15+
branches: [ main, develop ]
16+
paths:
17+
- 'examples/**/*.py'
18+
- 'agentops/**'
19+
- '.github/workflows/examples-integration-test.yml'
20+
workflow_dispatch:
21+
22+
env:
23+
PYTHON_VERSION: '3.11'
24+
25+
jobs:
26+
test-examples:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 30
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
example:
34+
# OpenAI examples
35+
- { path: 'examples/openai/openai_example_sync.py', name: 'OpenAI Sync' }
36+
- { path: 'examples/openai/openai_example_async.py', name: 'OpenAI Async' }
37+
- { path: 'examples/openai/multi_tool_orchestration.py', name: 'OpenAI Multi-Tool' }
38+
- { path: 'examples/openai/web_search.py', name: 'OpenAI Web Search' }
39+
- { path: 'examples/openai/o3_responses_example.py', name: 'OpenAI o3 Responses' }
40+
41+
# Anthropic examples
42+
- { path: 'examples/anthropic/anthropic-example-sync.py', name: 'Anthropic Sync' }
43+
- { path: 'examples/anthropic/anthropic-example-async.py', name: 'Anthropic Async' }
44+
- { path: 'examples/anthropic/agentops-anthropic-understanding-tools.py', name: 'Anthropic Tools' }
45+
46+
# LangChain examples
47+
- { path: 'examples/langchain/langchain_examples.py', name: 'LangChain' }
48+
49+
# LiteLLM examples
50+
- { path: 'examples/litellm/litellm_example.py', name: 'LiteLLM' }
51+
52+
# Google Generative AI examples
53+
- { path: 'examples/google_genai/gemini_example.py', name: 'Google Gemini' }
54+
55+
# xAI examples
56+
- { path: 'examples/xai/grok_examples.py', name: 'xAI Grok' }
57+
- { path: 'examples/xai/grok_vision_examples.py', name: 'xAI Grok Vision' }
58+
59+
# CrewAI examples
60+
- { path: 'examples/crewai/job_posting.py', name: 'CrewAI Job Posting' }
61+
- { path: 'examples/crewai/markdown_validator.py', name: 'CrewAI Markdown' }
62+
63+
# AutoGen examples
64+
- { path: 'examples/autogen/AgentChat.py', name: 'AutoGen Agent Chat' }
65+
- { path: 'examples/autogen/MathAgent.py', name: 'AutoGen Math Agent' }
66+
67+
# AG2 examples
68+
- { path: 'examples/ag2/async_human_input.py', name: 'AG2 Async Human Input' }
69+
- { path: 'examples/ag2/tools_wikipedia_search.py', name: 'AG2 Wikipedia Search' }
70+
71+
# Agno examples
72+
- { path: 'examples/agno/agno_async_operations.py', name: 'Agno Async Operations' }
73+
- { path: 'examples/agno/agno_basic_agents.py', name: 'Agno Basic Agents' }
74+
- { path: 'examples/agno/agno_research_team.py', name: 'Agno Research Team' }
75+
- { path: 'examples/agno/agno_tool_integrations.py', name: 'Agno Tool Integrations' }
76+
- { path: 'examples/agno/agno_workflow_setup.py', name: 'Agno Workflow Setup' }
77+
78+
# Google ADK examples
79+
- { path: 'examples/google_adk/human_approval.py', name: 'Google ADK Human Approval' }
80+
81+
# LlamaIndex examples
82+
# - { path: 'examples/llamaindex/llamaindex_example.py', name: 'LlamaIndex' }
83+
84+
# Mem0 examples
85+
- { path: 'examples/mem0/mem0_memoryclient_example.py', name: 'Mem0 Memory Client' }
86+
87+
# Watsonx examples
88+
- { path: 'examples/watsonx/watsonx-streaming.py', name: 'Watsonx Streaming' }
89+
- { path: 'examples/watsonx/watsonx-text-chat.py', name: 'Watsonx Text Chat' }
90+
- { path: 'examples/watsonx/watsonx-tokeniation-model.py', name: 'Watsonx Tokenization' }
91+
92+
# LangGraph examples
93+
- { path: 'examples/langgraph/langgraph_example.py', name: 'LangGraph' }
94+
95+
# Smolagents examples
96+
- { path: 'examples/smolagents/multi_smolagents_system.py', name: 'Smolagents Multi System' }
97+
- { path: 'examples/smolagents/text_to_sql.py', name: 'Smolagents Text to SQL' }
98+
99+
# OpenAI Agents examples
100+
- { path: 'examples/openai_agents/agent_guardrails.py', name: 'OpenAI Agents Guardrails' }
101+
- { path: 'examples/openai_agents/agent_patterns.py', name: 'OpenAI Agents Patterns' }
102+
- { path: 'examples/openai_agents/agents_tools.py', name: 'OpenAI Agents Tools' }
103+
- { path: 'examples/openai_agents/customer_service_agent.py', name: 'OpenAI Agents Customer Service' }
104+
105+
# Add more examples as needed
106+
107+
steps:
108+
- uses: actions/checkout@v4
109+
110+
- name: Set up Python
111+
uses: actions/setup-python@v4
112+
with:
113+
python-version: ${{ env.PYTHON_VERSION }}
114+
115+
- name: Install AgentOps
116+
run: |
117+
pip install -e .
118+
119+
- name: Install example dependencies
120+
run: |
121+
# Install common dependencies
122+
pip install python-dotenv requests
123+
124+
# Install from requirements.txt in the example's directory
125+
example_dir=$(dirname "${{ matrix.example.path }}")
126+
if [ -f "$example_dir/requirements.txt" ]; then
127+
echo "Installing dependencies from $example_dir/requirements.txt"
128+
pip install -r "$example_dir/requirements.txt"
129+
else
130+
echo "No requirements.txt found in $example_dir"
131+
fi
132+
133+
- name: Run example - ${{ matrix.example.name }}
134+
env:
135+
AGENTOPS_API_KEY: ${{ secrets.AGENTOPS_API_KEY }}
136+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
137+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
138+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
139+
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
140+
WATSONX_API_KEY: ${{ secrets.WATSONX_API_KEY }}
141+
WATSONX_PROJECT_ID: ${{ secrets.WATSONX_PROJECT_ID }}
142+
WATSONX_URL: ${{ secrets.WATSONX_URL }}
143+
MEM0_API_KEY: ${{ secrets.MEM0_API_KEY }}
144+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
145+
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
146+
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
147+
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
148+
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
149+
AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
150+
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}
151+
EXA_API_KEY: ${{ secrets.EXA_API_KEY }}
152+
LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
153+
PERPLEXITY_API_KEY: ${{ secrets.PERPLEXITY_API_KEY }}
154+
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }}
155+
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
156+
PYTHONPATH: ${{ github.workspace }}
157+
run: |
158+
echo "Running ${{ matrix.example.name }}..."
159+
python "${{ matrix.example.path }}" || exit 1
160+
161+
- name: Check for errors
162+
if: failure()
163+
run: |
164+
echo "Example ${{ matrix.example.name }} failed!"
165+
echo "Path: ${{ matrix.example.path }}"
166+
167+
# Show last 50 lines of any log files
168+
if [ -f agentops.log ]; then
169+
echo "=== AgentOps Log ==="
170+
tail -n 50 agentops.log
171+
fi
172+
173+
summary:
174+
needs: test-examples
175+
runs-on: ubuntu-latest
176+
if: always()
177+
178+
steps:
179+
- name: Summary
180+
run: |
181+
echo "## Examples Integration Test Summary" >> $GITHUB_STEP_SUMMARY
182+
echo "" >> $GITHUB_STEP_SUMMARY
183+
184+
if [ "${{ needs.test-examples.result }}" == "success" ]; then
185+
echo "✅ All examples passed!" >> $GITHUB_STEP_SUMMARY
186+
else
187+
echo "❌ Some examples failed. Check the logs above." >> $GITHUB_STEP_SUMMARY
188+
fi

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<a href="https://opensource.org/licenses/MIT">
2525
<img src="https://img.shields.io/badge/License-MIT-yellow.svg?&color=3670A0" alt="License: MIT">
2626
</a>
27+
<a href="https://smithery.ai/server/@AgentOps-AI/agentops-mcp">
28+
<img src="https://smithery.ai/badge/@AgentOps-AI/agentops-mcp"/>
29+
</a>
2730
</div>
2831

2932
<p align="center">
@@ -346,7 +349,7 @@ agent = initialize_agent(tools,
346349
handle_parsing_errors=True)
347350
```
348351

349-
Check out the [Langchain Examples Notebook](./examples/langchain_examples.ipynb) for more details including Async handlers.
352+
Check out the [Langchain Examples Notebook](./examples/langchain/langchain_examples.ipynb) for more details including Async handlers.
350353

351354
</details>
352355

0 commit comments

Comments
 (0)