Skip to content

Commit

Permalink
🎨 Format - ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Feb 23, 2024
1 parent f540c1c commit ab96b4e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ def spans_db_data():
"event_type": "fixture_call",
"start_time": str(datetime.now()),
"duration": 8.30,
"status": {
"value": "SUCCESS",
"error": None
},
"status": {"value": "SUCCESS", "error": None},
"end_time": str(datetime.now()),
"inputs": ["string"],
"outputs": ["string"],
Expand All @@ -126,10 +123,7 @@ def spans_db_data():
"event_type": "fixture_call",
"start_time": str(datetime.now()),
"duration": 13.30,
"status": {
"value": "SUCCESS",
"error": None
},
"status": {"value": "SUCCESS", "error": None},
"end_time": str(datetime.now()),
"inputs": ["string"],
"outputs": ["string"],
Expand All @@ -147,10 +141,7 @@ def spans_db_data():
"event_type": "fixture_call",
"start_time": str(datetime.now()),
"duration": 18.30,
"status": {
"value": "SUCCESS",
"error": None
},
"status": {"value": "SUCCESS", "error": None},
"end_time": str(datetime.now()),
"inputs": ["string"],
"outputs": ["string"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ async def test_create_trace_endpoint(trace_create_data):

@pytest.mark.asyncio
async def test_update_trace_status_endpoint():
payload = {
"status": random.choice(["initiated", "success", "failure"])
}
payload = {"status": random.choice(["initiated", "success", "failure"])}

traces = await TraceDB.find().to_list()
response = await test_client.put(
Expand Down
4 changes: 3 additions & 1 deletion agenta-cli/agenta/cli/variant_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def start_variant(variant_id: str, app_folder: str, host: str):
api_key=api_key,
)

endpoint = client.variants.start_variant(variant_id=variant_id, action={"action": "START"})
endpoint = client.variants.start_variant(
variant_id=variant_id, action={"action": "START"}
)
click.echo("\n" + click.style("Congratulations! 🎉", bold=True, fg="green"))
click.echo(
click.style("Your app has been deployed locally as an API. 🚀", fg="cyan")
Expand Down
5 changes: 2 additions & 3 deletions agenta-cli/agenta/sdk/agenta_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,11 @@ def init(app_name=None, base_name=None, **kwargs):


async def trace(**kwargs):
"""Function to start llm tracing.
"""
"""Function to start llm tracing."""

singleton = AgentaSingleton()

app_id = singleton.get_app(singleton.app_name)
base_id = singleton.get_app_base(app_id, singleton.base_name) # type: ignore
base_id = singleton.get_app_base(app_id, singleton.base_name) # type: ignore
llm_tracing = LLMTracing(singleton.host, singleton.api_key)
await llm_tracing.start_tracing(app_id, base_id, "default", **kwargs)
6 changes: 3 additions & 3 deletions agenta-cli/agenta/sdk/agenta_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def create_trace(
base_id: str,
config_name: str,
spans: List[str],
**kwargs: Dict[str, Any]
**kwargs: Dict[str, Any],
):
# calculate the latency between the trace start time and end time
trace_end_time = datetime.now()
Expand Down Expand Up @@ -54,7 +54,7 @@ async def create_span(
client: AsyncObservabilityClient,
parent_span_id: Optional[str],
event_name: str,
**kwargs: Dict[str, Any]
**kwargs: Dict[str, Any],
):
span = await client.create_span(
parent_span_id=parent_span_id,
Expand Down Expand Up @@ -92,7 +92,7 @@ async def start_tracing(
base_id=base_id,
config_name=config_name,
spans=[span],
**{**kwargs, "trace_start_time": trace_starting}, # type: ignore
**{**kwargs, "trace_start_time": trace_starting}, # type: ignore
)
except KeyError as exc:
print(f"Something happened when tracing LLM app. Error: {str(exc)}")
Expand Down

0 comments on commit ab96b4e

Please sign in to comment.