Skip to content

Fix missing @record_function decorator and AutoGen instrumentation reliability issues #1077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agentops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
end_session,
track_agent,
track_tool,
record_function,
end_all_sessions,
Session,
ToolEvent,
Expand Down Expand Up @@ -260,6 +261,7 @@ def end_trace(
"configure",
"get_client",
"record",
"record_function",
"start_trace",
"end_trace",
"start_session",
Expand Down
2 changes: 1 addition & 1 deletion agentops/instrumentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class InstrumentorConfig(TypedDict):
"class_name": "CrewAIInstrumentor",
"min_version": "0.56.0",
},
"autogen": {"module_name": "agentops.instrumentation.ag2", "class_name": "AG2Instrumentor", "min_version": "0.3.2"},
"ag2": {"module_name": "agentops.instrumentation.ag2", "class_name": "AG2Instrumentor", "min_version": "0.1.0"},
"agents": {
"module_name": "agentops.instrumentation.openai_agents",
"class_name": "OpenAIAgentsInstrumentor",
Expand Down
12 changes: 12 additions & 0 deletions agentops/legacy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,17 @@
return noop


@deprecated("Use @tool decorator instead.")
def record_function(*args: Any, **kwargs: Any) -> Any:
"""@deprecated Use @tool decorator instead. Wraps the @tool decorator for backward compatibility."""
from agentops.sdk.decorators import tool

Check warning on line 269 in agentops/legacy/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/legacy/__init__.py#L269

Added line #L269 was not covered by tests

if not args or not callable(args[0]):
return tool(*args, **kwargs)

Check warning on line 272 in agentops/legacy/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/legacy/__init__.py#L271-L272

Added lines #L271 - L272 were not covered by tests
else:
return tool(args[0], **kwargs)

Check warning on line 274 in agentops/legacy/__init__.py

View check run for this annotation

Codecov / codecov/patch

agentops/legacy/__init__.py#L274

Added line #L274 was not covered by tests


__all__ = [
"start_session",
"end_session",
Expand All @@ -271,6 +282,7 @@
"ActionEvent",
"track_agent",
"track_tool",
"record_function",
"end_all_sessions",
"Session",
"LLMEvent",
Expand Down
Loading