Skip to content

Commit 2c2f820

Browse files
authored
fix: Linting to pass static check (#1031)
* format * ruff
1 parent 8cd9007 commit 2c2f820

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

agentops/instrumentation/google_adk/patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ def _extract_llm_attributes(llm_request_dict: dict, llm_response: Any) -> dict:
278278
if "prompt_tokens_details" in usage:
279279
for detail in usage["prompt_tokens_details"]:
280280
if "modality" in detail and "token_count" in detail:
281-
attributes[f'gen_ai.usage.prompt_tokens.{detail["modality"].lower()}'] = detail[
281+
attributes[f"gen_ai.usage.prompt_tokens.{detail['modality'].lower()}"] = detail[
282282
"token_count"
283283
]
284284

285285
if "candidates_tokens_details" in usage:
286286
for detail in usage["candidates_tokens_details"]:
287287
if "modality" in detail and "token_count" in detail:
288-
attributes[f'gen_ai.usage.completion_tokens.{detail["modality"].lower()}'] = detail[
288+
attributes[f"gen_ai.usage.completion_tokens.{detail['modality'].lower()}"] = detail[
289289
"token_count"
290290
]
291291

agentops/sdk/decorators/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
tool = create_entity_decorator(SpanKind.TOOL)
2121
operation = task
2222

23+
2324
# For backward compatibility: @session decorator calls @trace decorator
2425
@functools.wraps(trace)
25-
def session(*args, **kwargs):
26+
def session(*args, **kwargs): # noqa: F811
2627
"""@deprecated Use @agentops.trace instead. Wraps the @trace decorator for backward compatibility."""
2728
logger.info(colored("@agentops.session decorator is deprecated. Please use @agentops.trace instead.", "yellow"))
2829
# If called as @session or @session(...)

examples/openai_agents_sdk/customer_service_agent.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"# IMPORTANT: After running this cell, restart the kernel before continuing.\n",
10-
"get_ipython().system('pip install -q -U agentops openai-agents')"
10+
"get_ipython().system(\"pip install -q -U agentops openai-agents\")"
1111
]
1212
},
1313
{
@@ -34,7 +34,7 @@
3434
"metadata": {},
3535
"outputs": [],
3636
"source": [
37-
"from __future__ import annotations as _annotations\n",
37+
"from __future__ import annotations as _annotations # noqa: F404\n",
3838
"\n",
3939
"import random\n",
4040
"import uuid\n",
@@ -44,7 +44,7 @@
4444
"# API key is automatically read from the environment variable\n",
4545
"agentops.init(tags=[\"customer-service-agent\", \"agentops-example\"])\n",
4646
"\n",
47-
"from agents import (\n",
47+
"from agents import ( # noqa: E402\n",
4848
" Agent,\n",
4949
" HandoffOutputItem,\n",
5050
" ItemHelpers,\n",
@@ -58,7 +58,7 @@
5858
" handoff,\n",
5959
" trace,\n",
6060
")\n",
61-
"from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX\n",
61+
"from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX # noqa: E402\n",
6262
"\n",
6363
"### CONTEXT\n",
6464
"\n",
@@ -217,7 +217,7 @@
217217
],
218218
"metadata": {
219219
"kernelspec": {
220-
"display_name": "base",
220+
"display_name": "agentops (3.11.11)",
221221
"language": "python",
222222
"name": "python3"
223223
},
@@ -231,7 +231,7 @@
231231
"name": "python",
232232
"nbconvert_exporter": "python",
233233
"pygments_lexer": "ipython3",
234-
"version": "3.12.7"
234+
"version": "3.11.11"
235235
}
236236
},
237237
"nbformat": 4,

examples/openai_agents_sdk/tool_usage_agent.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"# IMPORTANT: After running this cell, restart the kernel before continuing.\n",
10-
"get_ipython().system('pip install -q -U agentops openai-agents')"
10+
"get_ipython().system(\"pip install -q -U agentops openai-agents\")"
1111
]
1212
},
1313
{

examples/openai_agents_sdk/web_search_agent.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outputs": [],
88
"source": [
99
"# IMPORTANT: After running this cell, restart the kernel before continuing.\n",
10-
"get_ipython().system('pip install -q -U agentops openai-agents')"
10+
"get_ipython().system(\"pip install -q -U agentops openai-agents\")"
1111
]
1212
},
1313
{

0 commit comments

Comments
 (0)