Skip to content
Merged
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
4 changes: 2 additions & 2 deletions agentops/instrumentation/google_adk/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@
if "prompt_tokens_details" in usage:
for detail in usage["prompt_tokens_details"]:
if "modality" in detail and "token_count" in detail:
attributes[f'gen_ai.usage.prompt_tokens.{detail["modality"].lower()}'] = detail[
attributes[f"gen_ai.usage.prompt_tokens.{detail['modality'].lower()}"] = detail[

Check warning on line 281 in agentops/instrumentation/google_adk/patch.py

View check run for this annotation

Codecov / codecov/patch

agentops/instrumentation/google_adk/patch.py#L281

Added line #L281 was not covered by tests
"token_count"
]

if "candidates_tokens_details" in usage:
for detail in usage["candidates_tokens_details"]:
if "modality" in detail and "token_count" in detail:
attributes[f'gen_ai.usage.completion_tokens.{detail["modality"].lower()}'] = detail[
attributes[f"gen_ai.usage.completion_tokens.{detail['modality'].lower()}"] = detail[

Check warning on line 288 in agentops/instrumentation/google_adk/patch.py

View check run for this annotation

Codecov / codecov/patch

agentops/instrumentation/google_adk/patch.py#L288

Added line #L288 was not covered by tests
"token_count"
]

Expand Down
3 changes: 2 additions & 1 deletion agentops/sdk/decorators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
tool = create_entity_decorator(SpanKind.TOOL)
operation = task


# For backward compatibility: @session decorator calls @trace decorator
@functools.wraps(trace)
def session(*args, **kwargs):
def session(*args, **kwargs): # noqa: F811
"""@deprecated Use @agentops.trace instead. Wraps the @trace decorator for backward compatibility."""
logger.info(colored("@agentops.session decorator is deprecated. Please use @agentops.trace instead.", "yellow"))
# If called as @session or @session(...)
Expand Down
12 changes: 6 additions & 6 deletions examples/openai_agents_sdk/customer_service_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outputs": [],
"source": [
"# IMPORTANT: After running this cell, restart the kernel before continuing.\n",
"get_ipython().system('pip install -q -U agentops openai-agents')"
"get_ipython().system(\"pip install -q -U agentops openai-agents\")"
]
},
{
Expand All @@ -34,7 +34,7 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations as _annotations\n",
"from __future__ import annotations as _annotations # noqa: F404\n",
"\n",
"import random\n",
"import uuid\n",
Expand All @@ -44,7 +44,7 @@
"# API key is automatically read from the environment variable\n",
"agentops.init(tags=[\"customer-service-agent\", \"agentops-example\"])\n",
"\n",
"from agents import (\n",
"from agents import ( # noqa: E402\n",
" Agent,\n",
" HandoffOutputItem,\n",
" ItemHelpers,\n",
Expand All @@ -58,7 +58,7 @@
" handoff,\n",
" trace,\n",
")\n",
"from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX\n",
"from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX # noqa: E402\n",
"\n",
"### CONTEXT\n",
"\n",
Expand Down Expand Up @@ -217,7 +217,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "base",
"display_name": "agentops (3.11.11)",
"language": "python",
"name": "python3"
},
Expand All @@ -231,7 +231,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.11"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/openai_agents_sdk/tool_usage_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outputs": [],
"source": [
"# IMPORTANT: After running this cell, restart the kernel before continuing.\n",
"get_ipython().system('pip install -q -U agentops openai-agents')"
"get_ipython().system(\"pip install -q -U agentops openai-agents\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/openai_agents_sdk/web_search_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outputs": [],
"source": [
"# IMPORTANT: After running this cell, restart the kernel before continuing.\n",
"get_ipython().system('pip install -q -U agentops openai-agents')"
"get_ipython().system(\"pip install -q -U agentops openai-agents\")"
]
},
{
Expand Down
Loading