Skip to content

Commit a67a4af

Browse files
authored
fix: Hotfixes before the 0.4.15 release (#1083)
* check tools are not `None` * clear mem0 notebook * rename dir to `llamaindex` * fix notebooks metadata * title overrides when generating doc using script * sync ag2 version * remove ag2 human async example
1 parent 66ae700 commit a67a4af

File tree

13 files changed

+84
-699
lines changed

13 files changed

+84
-699
lines changed

agentops/instrumentation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class InstrumentorConfig(TypedDict):
9292
"class_name": "CrewAIInstrumentor",
9393
"min_version": "0.56.0",
9494
},
95-
"autogen": {"module_name": "agentops.instrumentation.ag2", "class_name": "AG2Instrumentor", "min_version": "0.1.0"},
95+
"autogen": {"module_name": "agentops.instrumentation.ag2", "class_name": "AG2Instrumentor", "min_version": "0.3.2"},
9696
"agents": {
9797
"module_name": "agentops.instrumentation.openai_agents",
9898
"class_name": "OpenAIAgentsInstrumentor",

agentops/instrumentation/ag2/instrumentor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AG2Instrumentor(BaseInstrumentor):
3232

3333
def instrumentation_dependencies(self) -> Collection[str]:
3434
"""Return packages required for instrumentation."""
35-
return ["autogen >= 0.3.2"]
35+
return ["ag2 >= 0.3.2"]
3636

3737
def _instrument(self, **kwargs):
3838
"""Instrument AG2 components."""

agentops/instrumentation/openai/wrappers/chat.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,13 @@ def handle_chat_attributes(
104104
# Tools
105105
if "tools" in kwargs:
106106
tools = kwargs["tools"]
107-
for i, tool in enumerate(tools):
108-
function = tool.get("function", {})
109-
prefix = f"{SpanAttributes.LLM_REQUEST_FUNCTIONS}.{i}"
110-
attributes[f"{prefix}.name"] = function.get("name")
111-
attributes[f"{prefix}.description"] = function.get("description")
112-
attributes[f"{prefix}.parameters"] = json.dumps(function.get("parameters"))
107+
if tools: # Check if tools is not None
108+
for i, tool in enumerate(tools):
109+
function = tool.get("function", {})
110+
prefix = f"{SpanAttributes.LLM_REQUEST_FUNCTIONS}.{i}"
111+
attributes[f"{prefix}.name"] = function.get("name")
112+
attributes[f"{prefix}.description"] = function.get("description")
113+
attributes[f"{prefix}.parameters"] = json.dumps(function.get("parameters"))
113114

114115
# Extract response attributes from return value
115116
if return_value:

examples/ag2/README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,14 @@ This directory contains examples of using AG2 (AutoGen 2.0) with AgentOps instru
1212

1313
## Examples
1414

15-
### 1. Agent Chat with Memory
16-
17-
Example: `agentchat_with_memory`
18-
This example demonstrates:
19-
- Agent chat with persistent memory
20-
21-
### 2. Asynchronous Human Input
15+
### 1. Asynchronous Human Input
2216

2317
Example: `async_human_input`
2418

2519
This example demonstrates:
2620
- Asynchronous human input handling
2721

28-
### 3. Wikipedia Search Tool
22+
### 2. Wikipedia Search Tool
2923

3024
Example: `tools_wikipedia_search`
3125

examples/ag2/agentchat_with_memory.ipynb

Lines changed: 0 additions & 320 deletions
This file was deleted.

0 commit comments

Comments
 (0)