Skip to content

Commit

Permalink
Style: format code with black
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed May 23, 2024
1 parent fc444d4 commit 411cb21
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions agenta-backend/agenta_backend/services/llm_apps_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ async def batch_invoke(
"delay_between_batches"
] # Delay between batches (in seconds)

list_of_app_outputs: List[
InvokationResult
] = [] # Outputs after running all batches
list_of_app_outputs: List[InvokationResult] = (
[]
) # Outputs after running all batches
openapi_parameters = await get_parameters_from_openapi(uri + "/openapi.json")

async def run_batch(start_idx: int):
Expand Down
14 changes: 8 additions & 6 deletions agenta-cli/agenta/client/backend/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def __init__(
self._client_wrapper = SyncClientWrapper(
base_url=base_url,
api_key=api_key,
httpx_client=httpx.Client(timeout=timeout)
if httpx_client is None
else httpx_client,
httpx_client=(
httpx.Client(timeout=timeout) if httpx_client is None else httpx_client
),
)
self.observability = ObservabilityClient(client_wrapper=self._client_wrapper)
self.apps = AppsClient(client_wrapper=self._client_wrapper)
Expand Down Expand Up @@ -1037,9 +1037,11 @@ def __init__(
self._client_wrapper = AsyncClientWrapper(
base_url=base_url,
api_key=api_key,
httpx_client=httpx.AsyncClient(timeout=timeout)
if httpx_client is None
else httpx_client,
httpx_client=(
httpx.AsyncClient(timeout=timeout)
if httpx_client is None
else httpx_client
),
)
self.observability = AsyncObservabilityClient(
client_wrapper=self._client_wrapper
Expand Down
1 change: 1 addition & 0 deletions agenta-cli/agenta/sdk/decorators/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Set global tracing variable to None
tracing = None


class instrument(BaseDecorator):
"""Decorator class for monitoring llm apps functions.
Expand Down
9 changes: 3 additions & 6 deletions agenta-cli/agenta/sdk/tracing/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@


class TracingContextManager:
def __init__(self, tracing: Tracing):
...
def __init__(self, tracing: Tracing): ...

def __enter__(self):
...
def __enter__(self): ...

def __exit__(self, exc_type, exc_val, exc_tb):
...
def __exit__(self, exc_type, exc_val, exc_tb): ...
6 changes: 4 additions & 2 deletions agenta-cli/agenta/sdk/tracing/llm_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ def start_span(
self.active_span = span
self.active_span = span
self.span_dict[span.id] = span
span.parent_span_id = self.parent_span_id # set the parent_span_id to the present span
self.parent_span_id = span.id # update parent_span_id to active span
span.parent_span_id = (
self.parent_span_id
) # set the parent_span_id to the present span
self.parent_span_id = span.id # update parent_span_id to active span

self.llm_logger.info(f"Recorded span and setting parent_span_id: {span.id}")
return span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)
llm_config = {"environment": "production"}


def hosted_platform_call(content: str):
span = tracing.start_span(
name="gpt3.5-llm-call",
Expand Down

0 comments on commit 411cb21

Please sign in to comment.