agentex-sdk 0.4.17__py3-none-any.whl → 0.4.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentex/_version.py +1 -1
- agentex/lib/cli/handlers/deploy_handlers.py +22 -17
- agentex/lib/core/services/adk/providers/openai.py +35 -55
- agentex/lib/environment_variables.py +1 -0
- agentex/lib/sdk/config/environment_config.py +10 -2
- agentex/lib/sdk/fastacp/base/base_acp_server.py +19 -1
- agentex/lib/sdk/fastacp/fastacp.py +0 -1
- agentex/lib/utils/logging.py +63 -15
- {agentex_sdk-0.4.17.dist-info → agentex_sdk-0.4.19.dist-info}/METADATA +4 -1
- {agentex_sdk-0.4.17.dist-info → agentex_sdk-0.4.19.dist-info}/RECORD +13 -13
- {agentex_sdk-0.4.17.dist-info → agentex_sdk-0.4.19.dist-info}/WHEEL +0 -0
- {agentex_sdk-0.4.17.dist-info → agentex_sdk-0.4.19.dist-info}/entry_points.txt +0 -0
- {agentex_sdk-0.4.17.dist-info → agentex_sdk-0.4.19.dist-info}/licenses/LICENSE +0 -0
agentex/_version.py
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
import os
|
2
|
-
import subprocess
|
3
2
|
import tempfile
|
4
|
-
|
3
|
+
import subprocess
|
5
4
|
from typing import Any
|
5
|
+
from pathlib import Path
|
6
6
|
|
7
7
|
import yaml
|
8
|
-
from pydantic import
|
8
|
+
from pydantic import Field, BaseModel
|
9
9
|
from rich.console import Console
|
10
10
|
|
11
|
-
from agentex.lib.
|
12
|
-
from agentex.lib.
|
13
|
-
from agentex.lib.cli.utils.
|
14
|
-
from agentex.lib.cli.utils.path_utils import calculate_docker_acp_module, PathResolutionError
|
11
|
+
from agentex.lib.utils.logging import make_logger
|
12
|
+
from agentex.lib.cli.utils.exceptions import HelmError, DeploymentError
|
13
|
+
from agentex.lib.cli.utils.path_utils import PathResolutionError, calculate_docker_acp_module
|
15
14
|
from agentex.lib.environment_variables import EnvVarKeys
|
15
|
+
from agentex.lib.cli.utils.kubectl_utils import check_and_switch_cluster_context
|
16
16
|
from agentex.lib.sdk.config.agent_config import AgentConfig
|
17
17
|
from agentex.lib.sdk.config.agent_manifest import AgentManifest
|
18
|
-
|
19
|
-
from agentex.lib.utils.logging import make_logger
|
18
|
+
from agentex.lib.sdk.config.environment_config import AgentEnvironmentConfig
|
20
19
|
|
21
20
|
logger = make_logger(__name__)
|
22
21
|
console = Console()
|
@@ -46,7 +45,7 @@ def check_helm_installed() -> bool:
|
|
46
45
|
return False
|
47
46
|
|
48
47
|
|
49
|
-
def add_helm_repo() -> None:
|
48
|
+
def add_helm_repo(helm_repository_name: str, helm_repository_url: str) -> None:
|
50
49
|
"""Add the agentex helm repository if not already added"""
|
51
50
|
try:
|
52
51
|
# Check if repo already exists
|
@@ -54,15 +53,15 @@ def add_helm_repo() -> None:
|
|
54
53
|
["helm", "repo", "list"], capture_output=True, text=True, check=True
|
55
54
|
)
|
56
55
|
|
57
|
-
if
|
56
|
+
if helm_repository_name not in result.stdout:
|
58
57
|
console.print("Adding agentex helm repository...")
|
59
58
|
subprocess.run(
|
60
59
|
[
|
61
60
|
"helm",
|
62
61
|
"repo",
|
63
62
|
"add",
|
64
|
-
|
65
|
-
|
63
|
+
helm_repository_name,
|
64
|
+
helm_repository_url,
|
66
65
|
],
|
67
66
|
check=True,
|
68
67
|
)
|
@@ -265,7 +264,7 @@ def merge_deployment_configs(
|
|
265
264
|
if not helm_overrides_command:
|
266
265
|
add_acp_command_to_helm_values(helm_values, manifest, manifest_path)
|
267
266
|
|
268
|
-
print("Deploying with the following helm values: ", helm_values)
|
267
|
+
console.print("Deploying with the following helm values: ", helm_values)
|
269
268
|
return helm_values
|
270
269
|
|
271
270
|
|
@@ -318,8 +317,14 @@ def deploy_agent(
|
|
318
317
|
else:
|
319
318
|
console.print(f"[yellow]⚠[/yellow] No environments.yaml found, skipping environment-specific config")
|
320
319
|
|
320
|
+
if agent_env_config:
|
321
|
+
helm_repository_name = agent_env_config.helm_repository_name
|
322
|
+
helm_repository_url = agent_env_config.helm_repository_url
|
323
|
+
else:
|
324
|
+
helm_repository_name = "scale-egp"
|
325
|
+
helm_repository_url = "https://scale-egp-helm-charts-us-west-2.s3.amazonaws.com/charts"
|
321
326
|
# Add helm repository/update
|
322
|
-
add_helm_repo()
|
327
|
+
add_helm_repo(helm_repository_name, helm_repository_url)
|
323
328
|
|
324
329
|
# Merge configurations
|
325
330
|
helm_values = merge_deployment_configs(manifest, agent_env_config, deploy_overrides, manifest_path)
|
@@ -349,7 +354,7 @@ def deploy_agent(
|
|
349
354
|
"helm",
|
350
355
|
"upgrade",
|
351
356
|
release_name,
|
352
|
-
"
|
357
|
+
f"{helm_repository_name}/agentex-agent",
|
353
358
|
"--version",
|
354
359
|
AGENTEX_AGENTS_HELM_CHART_VERSION,
|
355
360
|
"-f",
|
@@ -371,7 +376,7 @@ def deploy_agent(
|
|
371
376
|
"helm",
|
372
377
|
"install",
|
373
378
|
release_name,
|
374
|
-
"
|
379
|
+
f"{helm_repository_name}/agentex-agent",
|
375
380
|
"--version",
|
376
381
|
AGENTEX_AGENTS_HELM_CHART_VERSION,
|
377
382
|
"-f",
|
@@ -358,6 +358,7 @@ class OpenAIService:
|
|
358
358
|
},
|
359
359
|
) as span:
|
360
360
|
heartbeat_if_in_workflow("run agent auto send")
|
361
|
+
|
361
362
|
async with mcp_server_context(mcp_server_params, mcp_timeout_seconds) as servers:
|
362
363
|
tools = [tool.to_oai_function_tool() for tool in tools] if tools else []
|
363
364
|
handoffs = [Agent(**handoff.model_dump()) for handoff in handoffs] if handoffs else []
|
@@ -395,9 +396,12 @@ class OpenAIService:
|
|
395
396
|
result = await Runner.run(
|
396
397
|
starting_agent=agent, input=input_list, previous_response_id=previous_response_id
|
397
398
|
)
|
398
|
-
|
399
|
-
|
400
|
-
|
399
|
+
else:
|
400
|
+
result = await Runner.run(starting_agent=agent, input=input_list)
|
401
|
+
|
402
|
+
if span:
|
403
|
+
span.output = {
|
404
|
+
"new_items": [
|
401
405
|
item.raw_item.model_dump() if isinstance(item.raw_item, BaseModel) else item.raw_item
|
402
406
|
for item in result.new_items
|
403
407
|
],
|
@@ -427,6 +431,7 @@ class OpenAIService:
|
|
427
431
|
|
428
432
|
elif item.type == "tool_call_item":
|
429
433
|
tool_call_item = item.raw_item
|
434
|
+
|
430
435
|
# Extract tool call information using the helper method
|
431
436
|
call_id, tool_name, tool_arguments = self._extract_tool_call_info(tool_call_item)
|
432
437
|
tool_call_map[call_id] = tool_call_item
|
@@ -552,15 +557,9 @@ class OpenAIService:
|
|
552
557
|
) as span:
|
553
558
|
heartbeat_if_in_workflow("run agent streamed")
|
554
559
|
|
555
|
-
async with mcp_server_context(
|
556
|
-
mcp_server_params, mcp_timeout_seconds
|
557
|
-
) as servers:
|
560
|
+
async with mcp_server_context(mcp_server_params, mcp_timeout_seconds) as servers:
|
558
561
|
tools = [tool.to_oai_function_tool() for tool in tools] if tools else []
|
559
|
-
handoffs = (
|
560
|
-
[Agent(**handoff.model_dump()) for handoff in handoffs]
|
561
|
-
if handoffs
|
562
|
-
else []
|
563
|
-
)
|
562
|
+
handoffs = [Agent(**handoff.model_dump()) for handoff in handoffs] if handoffs else []
|
564
563
|
agent_kwargs = {
|
565
564
|
"name": agent_name,
|
566
565
|
"instructions": agent_instructions,
|
@@ -573,9 +572,7 @@ class OpenAIService:
|
|
573
572
|
"tool_use_behavior": tool_use_behavior,
|
574
573
|
}
|
575
574
|
if model_settings is not None:
|
576
|
-
agent_kwargs["model_settings"] = (
|
577
|
-
model_settings.to_oai_model_settings()
|
578
|
-
)
|
575
|
+
agent_kwargs["model_settings"] = model_settings.to_oai_model_settings()
|
579
576
|
if input_guardrails is not None:
|
580
577
|
agent_kwargs["input_guardrails"] = input_guardrails
|
581
578
|
if output_guardrails is not None:
|
@@ -603,9 +600,7 @@ class OpenAIService:
|
|
603
600
|
if span:
|
604
601
|
span.output = {
|
605
602
|
"new_items": [
|
606
|
-
item.raw_item.model_dump()
|
607
|
-
if isinstance(item.raw_item, BaseModel)
|
608
|
-
else item.raw_item
|
603
|
+
item.raw_item.model_dump() if isinstance(item.raw_item, BaseModel) else item.raw_item
|
609
604
|
for item in result.new_items
|
610
605
|
],
|
611
606
|
"final_output": result.final_output,
|
@@ -738,6 +733,7 @@ class OpenAIService:
|
|
738
733
|
if event.type == "run_item_stream_event":
|
739
734
|
if event.item.type == "tool_call_item":
|
740
735
|
tool_call_item = event.item.raw_item
|
736
|
+
|
741
737
|
# Extract tool call information using the helper method
|
742
738
|
call_id, tool_name, tool_arguments = self._extract_tool_call_info(tool_call_item)
|
743
739
|
tool_call_map[call_id] = tool_call_item
|
@@ -750,12 +746,10 @@ class OpenAIService:
|
|
750
746
|
)
|
751
747
|
|
752
748
|
# Create tool request using streaming context (immediate completion)
|
753
|
-
async with (
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
) as streaming_context
|
758
|
-
):
|
749
|
+
async with self.streaming_service.streaming_task_message_context(
|
750
|
+
task_id=task_id,
|
751
|
+
initial_content=tool_request_content,
|
752
|
+
) as streaming_context:
|
759
753
|
# The message has already been persisted, but we still need to send an upda
|
760
754
|
await streaming_context.stream_update(
|
761
755
|
update=StreamTaskMessageFull(
|
@@ -781,12 +775,9 @@ class OpenAIService:
|
|
781
775
|
)
|
782
776
|
|
783
777
|
# Create tool response using streaming context (immediate completion)
|
784
|
-
async with (
|
785
|
-
|
786
|
-
|
787
|
-
initial_content=tool_response_content
|
788
|
-
) as streaming_context
|
789
|
-
):
|
778
|
+
async with self.streaming_service.streaming_task_message_context(
|
779
|
+
task_id=task_id, initial_content=tool_response_content
|
780
|
+
) as streaming_context:
|
790
781
|
# The message has already been persisted, but we still need to send an update
|
791
782
|
await streaming_context.stream_update(
|
792
783
|
update=StreamTaskMessageFull(
|
@@ -812,14 +803,10 @@ class OpenAIService:
|
|
812
803
|
),
|
813
804
|
)
|
814
805
|
# Open the streaming context
|
815
|
-
item_id_to_streaming_context[
|
816
|
-
item_id
|
817
|
-
] = await streaming_context.open()
|
806
|
+
item_id_to_streaming_context[item_id] = await streaming_context.open()
|
818
807
|
unclosed_item_ids.add(item_id)
|
819
808
|
else:
|
820
|
-
streaming_context = item_id_to_streaming_context[
|
821
|
-
item_id
|
822
|
-
]
|
809
|
+
streaming_context = item_id_to_streaming_context[item_id]
|
823
810
|
|
824
811
|
# Stream the delta through the streaming service
|
825
812
|
await streaming_context.stream_update(
|
@@ -849,14 +836,10 @@ class OpenAIService:
|
|
849
836
|
),
|
850
837
|
)
|
851
838
|
# Open the streaming context
|
852
|
-
item_id_to_streaming_context[
|
853
|
-
item_id
|
854
|
-
] = await streaming_context.open()
|
839
|
+
item_id_to_streaming_context[item_id] = await streaming_context.open()
|
855
840
|
unclosed_item_ids.add(item_id)
|
856
841
|
else:
|
857
|
-
streaming_context = item_id_to_streaming_context[
|
858
|
-
item_id
|
859
|
-
]
|
842
|
+
streaming_context = item_id_to_streaming_context[item_id]
|
860
843
|
|
861
844
|
# Stream the summary delta through the streaming service
|
862
845
|
await streaming_context.stream_update(
|
@@ -890,14 +873,10 @@ class OpenAIService:
|
|
890
873
|
),
|
891
874
|
)
|
892
875
|
# Open the streaming context
|
893
|
-
item_id_to_streaming_context[
|
894
|
-
item_id
|
895
|
-
] = await streaming_context.open()
|
876
|
+
item_id_to_streaming_context[item_id] = await streaming_context.open()
|
896
877
|
unclosed_item_ids.add(item_id)
|
897
878
|
else:
|
898
|
-
streaming_context = item_id_to_streaming_context[
|
899
|
-
item_id
|
900
|
-
]
|
879
|
+
streaming_context = item_id_to_streaming_context[item_id]
|
901
880
|
|
902
881
|
# Stream the content delta through the streaming service
|
903
882
|
await streaming_context.stream_update(
|
@@ -925,6 +904,7 @@ class OpenAIService:
|
|
925
904
|
# to close the streaming context, but they do!!!
|
926
905
|
# They output both a ResponseReasoningSummaryTextDoneEvent and a ResponseReasoningSummaryPartDoneEvent
|
927
906
|
# I have no idea why they do this.
|
907
|
+
|
928
908
|
elif isinstance(event.data, ResponseReasoningTextDoneEvent):
|
929
909
|
# Handle reasoning content text completion
|
930
910
|
item_id = event.data.item_id
|
@@ -940,9 +920,7 @@ class OpenAIService:
|
|
940
920
|
|
941
921
|
# Finish the streaming context (sends DONE event and updates message)
|
942
922
|
if item_id in item_id_to_streaming_context:
|
943
|
-
streaming_context = item_id_to_streaming_context[
|
944
|
-
item_id
|
945
|
-
]
|
923
|
+
streaming_context = item_id_to_streaming_context[item_id]
|
946
924
|
await streaming_context.close()
|
947
925
|
if item_id in unclosed_item_ids:
|
948
926
|
unclosed_item_ids.remove(item_id)
|
@@ -952,17 +930,17 @@ class OpenAIService:
|
|
952
930
|
# Create a copy to avoid modifying set during iteration
|
953
931
|
remaining_items = list(unclosed_item_ids)
|
954
932
|
for item_id in remaining_items:
|
955
|
-
if (
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
]
|
933
|
+
if (
|
934
|
+
item_id in unclosed_item_ids and item_id in item_id_to_streaming_context
|
935
|
+
): # Check if still unclosed
|
936
|
+
streaming_context = item_id_to_streaming_context[item_id]
|
960
937
|
await streaming_context.close()
|
961
938
|
unclosed_item_ids.discard(item_id)
|
962
939
|
|
963
940
|
except InputGuardrailTripwireTriggered as e:
|
964
941
|
# Handle guardrail trigger by sending a rejection message
|
965
942
|
rejection_message = "I'm sorry, but I cannot process this request due to a guardrail. Please try a different question."
|
943
|
+
|
966
944
|
# Try to extract rejection message from the guardrail result
|
967
945
|
if hasattr(e, "guardrail_result") and hasattr(e.guardrail_result, "output"):
|
968
946
|
output_info = getattr(e.guardrail_result.output, "output_info", {})
|
@@ -993,6 +971,7 @@ class OpenAIService:
|
|
993
971
|
type="full",
|
994
972
|
),
|
995
973
|
)
|
974
|
+
|
996
975
|
# Re-raise to let the activity handle it
|
997
976
|
raise
|
998
977
|
|
@@ -1030,6 +1009,7 @@ class OpenAIService:
|
|
1030
1009
|
type="full",
|
1031
1010
|
),
|
1032
1011
|
)
|
1012
|
+
|
1033
1013
|
# Re-raise to let the activity handle it
|
1034
1014
|
raise
|
1035
1015
|
|
@@ -7,11 +7,11 @@ configurations that are separate from the main manifest.yaml file.
|
|
7
7
|
|
8
8
|
from __future__ import annotations
|
9
9
|
|
10
|
-
from pathlib import Path
|
11
10
|
from typing import Any, Dict, override
|
11
|
+
from pathlib import Path
|
12
12
|
|
13
13
|
import yaml
|
14
|
-
from pydantic import
|
14
|
+
from pydantic import Field, BaseModel, field_validator
|
15
15
|
|
16
16
|
from agentex.lib.utils.model_utils import BaseModel as UtilsBaseModel
|
17
17
|
|
@@ -73,6 +73,14 @@ class AgentEnvironmentConfig(BaseModel):
|
|
73
73
|
...,
|
74
74
|
description="Authentication and authorization configuration"
|
75
75
|
)
|
76
|
+
helm_repository_name: str = Field(
|
77
|
+
default="scale-egp",
|
78
|
+
description="Helm repository name for the environment"
|
79
|
+
)
|
80
|
+
helm_repository_url: str = Field(
|
81
|
+
default="https://scale-egp-helm-charts-us-west-2.s3.amazonaws.com/charts",
|
82
|
+
description="Helm repository url for the environment"
|
83
|
+
)
|
76
84
|
helm_overrides: Dict[str, Any] = Field(
|
77
85
|
default_factory=dict,
|
78
86
|
description="Helm chart value overrides for environment-specific tuning"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import asyncio
|
2
2
|
import inspect
|
3
|
+
import uuid
|
3
4
|
from datetime import datetime
|
4
5
|
from collections.abc import AsyncGenerator, Awaitable, Callable
|
5
6
|
from contextlib import asynccontextmanager
|
@@ -9,6 +10,7 @@ import uvicorn
|
|
9
10
|
from fastapi import FastAPI, Request
|
10
11
|
from fastapi.responses import StreamingResponse
|
11
12
|
from pydantic import TypeAdapter, ValidationError
|
13
|
+
from starlette.middleware.base import BaseHTTPMiddleware
|
12
14
|
|
13
15
|
# from agentex.lib.sdk.fastacp.types import BaseACPConfig
|
14
16
|
from agentex.lib.environment_variables import EnvironmentVariables, refreshed_environment_variables
|
@@ -24,7 +26,7 @@ from agentex.lib.types.acp import (
|
|
24
26
|
from agentex.lib.types.json_rpc import JSONRPCError, JSONRPCRequest, JSONRPCResponse
|
25
27
|
from agentex.types.task_message_update import StreamTaskMessageFull, TaskMessageUpdate
|
26
28
|
from agentex.types.task_message_content import TaskMessageContent
|
27
|
-
from agentex.lib.utils.logging import make_logger
|
29
|
+
from agentex.lib.utils.logging import ctx_var_request_id, make_logger
|
28
30
|
from agentex.lib.utils.model_utils import BaseModel
|
29
31
|
from agentex.lib.utils.registration import register_agent
|
30
32
|
from agentex.lib.sdk.fastacp.base.constants import (
|
@@ -38,6 +40,20 @@ logger = make_logger(__name__)
|
|
38
40
|
task_message_update_adapter = TypeAdapter(TaskMessageUpdate)
|
39
41
|
|
40
42
|
|
43
|
+
class RequestIDMiddleware(BaseHTTPMiddleware):
|
44
|
+
"""Middleware to extract or generate request IDs and add them to logs and response headers"""
|
45
|
+
|
46
|
+
async def dispatch(self, request: Request, call_next):
|
47
|
+
# Extract request ID from header or generate a new one if there isn't one
|
48
|
+
request_id = request.headers.get("x-request-id") or uuid.uuid4().hex
|
49
|
+
logger.info(f"Request ID: {request_id}")
|
50
|
+
# Store request ID in request state for access in handlers
|
51
|
+
ctx_var_request_id.set(request_id)
|
52
|
+
# Process request
|
53
|
+
response = await call_next(request)
|
54
|
+
return response
|
55
|
+
|
56
|
+
|
41
57
|
class BaseACPServer(FastAPI):
|
42
58
|
"""
|
43
59
|
AsyncAgentACP provides RPC-style hooks for agent events and commands asynchronously.
|
@@ -56,6 +72,8 @@ class BaseACPServer(FastAPI):
|
|
56
72
|
self.post("/api")(self._handle_jsonrpc)
|
57
73
|
|
58
74
|
# Method handlers
|
75
|
+
# this just adds a request ID to the request and response headers
|
76
|
+
self.add_middleware(RequestIDMiddleware)
|
59
77
|
self._handlers: dict[RPCMethod, Callable] = {}
|
60
78
|
|
61
79
|
@classmethod
|
agentex/lib/utils/logging.py
CHANGED
@@ -1,31 +1,79 @@
|
|
1
1
|
import logging
|
2
|
-
|
2
|
+
import contextvars
|
3
3
|
from rich.console import Console
|
4
4
|
from rich.logging import RichHandler
|
5
|
+
import json_log_formatter
|
6
|
+
import os
|
7
|
+
import ddtrace
|
8
|
+
from ddtrace import tracer
|
9
|
+
|
10
|
+
_is_datadog_configured = bool(os.environ.get("DD_AGENT_HOST"))
|
11
|
+
|
12
|
+
ctx_var_request_id = contextvars.ContextVar[str]("request_id")
|
13
|
+
|
14
|
+
|
15
|
+
class CustomJSONFormatter(json_log_formatter.JSONFormatter):
|
16
|
+
def json_record(self, message: str, extra: dict, record: logging.LogRecord) -> dict:
|
17
|
+
extra = super().json_record(message, extra, record)
|
18
|
+
extra["level"] = record.levelname
|
19
|
+
extra["name"] = record.name
|
20
|
+
extra["lineno"] = record.lineno
|
21
|
+
extra["pathname"] = record.pathname
|
22
|
+
extra["request_id"] = ctx_var_request_id.get(None)
|
23
|
+
if _is_datadog_configured:
|
24
|
+
extra["dd.trace_id"] = tracer.get_log_correlation_context().get("dd.trace_id", None) or getattr(
|
25
|
+
record, "dd.trace_id", 0
|
26
|
+
)
|
27
|
+
extra["dd.span_id"] = tracer.get_log_correlation_context().get("dd.span_id", None) or getattr(
|
28
|
+
record, "dd.span_id", 0
|
29
|
+
)
|
30
|
+
# add the env, service, and version configured for the tracer
|
31
|
+
# If tracing is not set up, then this should pull values from DD_ENV, DD_SERVICE, and DD_VERSION.
|
32
|
+
service_override = ddtrace.config.service or os.getenv("DD_SERVICE")
|
33
|
+
if service_override:
|
34
|
+
extra["dd.service"] = service_override
|
35
|
+
|
36
|
+
env_override = ddtrace.config.env or os.getenv("DD_ENV")
|
37
|
+
if env_override:
|
38
|
+
extra["dd.env"] = env_override
|
5
39
|
|
40
|
+
version_override = ddtrace.config.version or os.getenv("DD_VERSION")
|
41
|
+
if version_override:
|
42
|
+
extra["dd.version"] = version_override
|
6
43
|
|
7
|
-
|
44
|
+
return extra
|
45
|
+
|
46
|
+
def make_logger(name: str) -> logging.Logger:
|
8
47
|
"""
|
9
48
|
Creates a logger object with a RichHandler to print colored text.
|
10
49
|
:param name: The name of the module to create the logger for.
|
11
50
|
:return: A logger object.
|
12
51
|
"""
|
13
52
|
# Create a console object to print colored text
|
14
|
-
console = Console()
|
15
|
-
|
16
|
-
# Create a logger object with the name of the current module
|
17
53
|
logger = logging.getLogger(name)
|
18
|
-
|
19
|
-
# Set the global log level to INFO
|
20
54
|
logger.setLevel(logging.INFO)
|
21
55
|
|
22
|
-
|
23
|
-
|
24
|
-
console=
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
56
|
+
environment = os.getenv("ENVIRONMENT")
|
57
|
+
if environment == "local":
|
58
|
+
console = Console()
|
59
|
+
# Add the RichHandler to the logger to print colored text
|
60
|
+
handler = RichHandler(
|
61
|
+
console=console,
|
62
|
+
show_level=False,
|
63
|
+
show_path=False,
|
64
|
+
show_time=False,
|
65
|
+
)
|
66
|
+
logger.addHandler(handler)
|
67
|
+
return logger
|
68
|
+
|
69
|
+
stream_handler = logging.StreamHandler()
|
70
|
+
if _is_datadog_configured:
|
71
|
+
stream_handler.setFormatter(CustomJSONFormatter())
|
72
|
+
else:
|
73
|
+
stream_handler.setFormatter(
|
74
|
+
logging.Formatter("%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] - %(message)s")
|
75
|
+
)
|
30
76
|
|
77
|
+
logger.addHandler(stream_handler)
|
78
|
+
# Create a logger object with the name of the current module
|
31
79
|
return logger
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: agentex-sdk
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.19
|
4
4
|
Summary: The official Python library for the agentex API
|
5
5
|
Project-URL: Homepage, https://github.com/scaleapi/agentex-python
|
6
6
|
Project-URL: Repository, https://github.com/scaleapi/agentex-python
|
@@ -22,11 +22,14 @@ Requires-Python: <4,>=3.12
|
|
22
22
|
Requires-Dist: aiohttp<4,>=3.10.10
|
23
23
|
Requires-Dist: anyio<5,>=3.5.0
|
24
24
|
Requires-Dist: cloudpickle>=3.1.1
|
25
|
+
Requires-Dist: datadog>=0.52.1
|
26
|
+
Requires-Dist: ddtrace>=3.13.0
|
25
27
|
Requires-Dist: distro<2,>=1.7.0
|
26
28
|
Requires-Dist: fastapi<0.116,>=0.115.0
|
27
29
|
Requires-Dist: httpx<0.28,>=0.27.2
|
28
30
|
Requires-Dist: ipykernel>=6.29.5
|
29
31
|
Requires-Dist: jinja2<4,>=3.1.3
|
32
|
+
Requires-Dist: json-log-formatter>=1.1.1
|
30
33
|
Requires-Dist: jsonref<2,>=1.1.0
|
31
34
|
Requires-Dist: jsonschema<5,>=4.23.0
|
32
35
|
Requires-Dist: kubernetes<29.0.0,>=25.0.0
|
@@ -11,7 +11,7 @@ agentex/_resource.py,sha256=S1t7wmR5WUvoDIhZjo_x-E7uoTJBynJ3d8tPJMQYdjw,1106
|
|
11
11
|
agentex/_response.py,sha256=Tb9zazsnemO2rTxWtBjAD5WBqlhli5ZaXGbiKgdu5DE,28794
|
12
12
|
agentex/_streaming.py,sha256=FNGJExRCF-vTRUZHFKUfoAWFhDGOB3XbioVCF37Jr7E,10104
|
13
13
|
agentex/_types.py,sha256=lO491FSd7vM_uBp7-TvItbauEAH8SsEPYcyNO_5lKGM,7297
|
14
|
-
agentex/_version.py,sha256=
|
14
|
+
agentex/_version.py,sha256=6BcFOkutui_Zk8paug6PcP6bW9nEWC3lUJBtRbIwUOM,159
|
15
15
|
agentex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
agentex/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
17
17
|
agentex/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
@@ -27,7 +27,7 @@ agentex/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,478
|
|
27
27
|
agentex/_utils/_utils.py,sha256=D2QE7mVPNEJzaB50u8rvDQAUDS5jx7JoeFD7zdj-TeI,12231
|
28
28
|
agentex/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
29
29
|
agentex/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
|
-
agentex/lib/environment_variables.py,sha256=
|
30
|
+
agentex/lib/environment_variables.py,sha256=3vnoPoG3UyVAnPV8bwa93CFkapdr0DuND85oMAJzkZE,3389
|
31
31
|
agentex/lib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
agentex/lib/adk/__init__.py,sha256=-PpVfEvYr_HD7TnxUWU8RCW2OnxfwpPxTW97dKTnqvI,1082
|
33
33
|
agentex/lib/adk/_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -63,7 +63,7 @@ agentex/lib/cli/debug/debug_handlers.py,sha256=i2Og0v5MPKIxG0uMZIp4NpmCpAro23t7P
|
|
63
63
|
agentex/lib/cli/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
64
64
|
agentex/lib/cli/handlers/agent_handlers.py,sha256=iVZ-4TSQJuq7XpPBYjYIN76M33XwxDjQTuNwTzzynec,5573
|
65
65
|
agentex/lib/cli/handlers/cleanup_handlers.py,sha256=V1V0zeErOUGTgCQqjyUl6CWtzGjFW878uzFaLOQJEyQ,7073
|
66
|
-
agentex/lib/cli/handlers/deploy_handlers.py,sha256=
|
66
|
+
agentex/lib/cli/handlers/deploy_handlers.py,sha256=VFEUXaA6IZRfrXBiUiHr-2RLePxTixE5a3bx5U6M2As,16447
|
67
67
|
agentex/lib/cli/handlers/run_handlers.py,sha256=TMelCWTwFxUJJJ7At3zG-cXTn2mBmK1ZJuJ63Ero6xs,15396
|
68
68
|
agentex/lib/cli/handlers/secret_handlers.py,sha256=VfAdAQovW9tG36Xgk_gGIGwTyFMxR3P6xc7fmAviNA8,24719
|
69
69
|
agentex/lib/cli/templates/default/.dockerignore.j2,sha256=hweGFxw5eDZYsb5EnRHpv27o9M1HF2PEWOxqsfBBcAE,320
|
@@ -134,7 +134,7 @@ agentex/lib/core/services/adk/acp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
134
134
|
agentex/lib/core/services/adk/acp/acp.py,sha256=ONbGc8HWNCxv5IJaItY-fvDZIwlh3d4jSmH9GGQo7q8,10971
|
135
135
|
agentex/lib/core/services/adk/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
136
136
|
agentex/lib/core/services/adk/providers/litellm.py,sha256=EKzus_xohNW-85V5hwvd1WqUd3ebv2wc9vDIWO2t1Mw,10044
|
137
|
-
agentex/lib/core/services/adk/providers/openai.py,sha256=
|
137
|
+
agentex/lib/core/services/adk/providers/openai.py,sha256=pXbqSBPxvnOV_h3c-iaUXFgkmNRyu97C1xGIFMOw8zY,51832
|
138
138
|
agentex/lib/core/services/adk/providers/sgp.py,sha256=9gm-sPNQ_OSTaBzL0onerKhokPk_ZHndaKNO-z16wyQ,3676
|
139
139
|
agentex/lib/core/services/adk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
140
140
|
agentex/lib/core/services/adk/utils/templating.py,sha256=eaXSFq31Y9p5pRD6J6SL4QdTFtxy81dilbF2XXc2JYQ,1889
|
@@ -178,13 +178,13 @@ agentex/lib/sdk/config/agent_config.py,sha256=WhLMd15po3loE67LNPjCGSG5xhvv4KH6xV
|
|
178
178
|
agentex/lib/sdk/config/agent_manifest.py,sha256=GXEVZ9OEHPA4ESSNG4miCFjxiHhxmAWbe6nYwbiC3JM,8626
|
179
179
|
agentex/lib/sdk/config/build_config.py,sha256=KI7SfVxGrv0rxJCIBuMT5M4oJ2o9n46LRH0t6fIki3g,1049
|
180
180
|
agentex/lib/sdk/config/deployment_config.py,sha256=lbOx2g0Q2gbo9CqWFejzmiYqh3GLndpB7_gX6R92t0g,3992
|
181
|
-
agentex/lib/sdk/config/environment_config.py,sha256=
|
181
|
+
agentex/lib/sdk/config/environment_config.py,sha256=RrQPMHNAKOuqGpXPDKoQNi50lXssLOncIYLy4iwbrxs,6790
|
182
182
|
agentex/lib/sdk/config/local_development_config.py,sha256=b1AZsOVo1RoHKbk8Nm5nC8jcjJSOxKkKBv9gLhFLX8s,1697
|
183
183
|
agentex/lib/sdk/config/project_config.py,sha256=CGH_r9KbnSFMj2CnBkZnfg41L2o0TeVNz6MwBDKPT_U,3642
|
184
184
|
agentex/lib/sdk/config/validation.py,sha256=QGAlAzlVJiWRlIksqxNS-JSwkk8Z4gXMSFUJc4qPrIQ,8989
|
185
185
|
agentex/lib/sdk/fastacp/__init__.py,sha256=UvAdexdnfb4z0F4a2sfXROFyh9EjH89kf3AxHPybzCM,75
|
186
|
-
agentex/lib/sdk/fastacp/fastacp.py,sha256=
|
187
|
-
agentex/lib/sdk/fastacp/base/base_acp_server.py,sha256=
|
186
|
+
agentex/lib/sdk/fastacp/fastacp.py,sha256=RM89_4_G2ZtIybPeMg641cw4ixFn4rZHy260FGSAa6o,3770
|
187
|
+
agentex/lib/sdk/fastacp/base/base_acp_server.py,sha256=QLSdJVVW3E2K6qdHI6ZWQpAoOsfXQ_wk5Q6cFA2N5G4,16435
|
188
188
|
agentex/lib/sdk/fastacp/base/constants.py,sha256=W4vpJ-5NML7239JyqzUWdu2IypIl8Cey8CS41KR2Vk0,519
|
189
189
|
agentex/lib/sdk/fastacp/impl/agentic_base_acp.py,sha256=LWLAlHrs-2Lc2UICBAEFL8c3JwTA6oxPnzUzW0qQWSA,2694
|
190
190
|
agentex/lib/sdk/fastacp/impl/sync_acp.py,sha256=0y_cYD-0UJOiVJv-BBMOt6PvElDf5zmc1uvbr81VcSI,3897
|
@@ -221,7 +221,7 @@ agentex/lib/utils/debug.py,sha256=1o2NjG8bZXTi63KTGjL3EmU_zMGapco7v5xoDuZRjU8,21
|
|
221
221
|
agentex/lib/utils/io.py,sha256=17p7dfUZ1YxTAc-n_g7eFOjzInoKi7Uedyad967EKYQ,754
|
222
222
|
agentex/lib/utils/iterables.py,sha256=cD49hj98mtY0QPaS0ZA2kguNeGzRU4UfbZfwyASWdzY,319
|
223
223
|
agentex/lib/utils/json_schema.py,sha256=nSHbi6LC-oWXHP6sMLCBychA7B0R2DItRIJNCCEzRsY,741
|
224
|
-
agentex/lib/utils/logging.py,sha256=
|
224
|
+
agentex/lib/utils/logging.py,sha256=osfi7UUiZ30As6z3vgn1djdGLlzTO3SBYiX6212TKAg,2911
|
225
225
|
agentex/lib/utils/mcp.py,sha256=lYQPwKAOH6Gf2I_TeovhEG9YUijUPcN0rENNdT0Vk6c,505
|
226
226
|
agentex/lib/utils/model_utils.py,sha256=bkcB1I0DMRAtFQpznsXgFGKZGrT7NGJ4tIwFM4dtUXQ,2547
|
227
227
|
agentex/lib/utils/parsing.py,sha256=2T-B4nJSupo2RLf9AkpV6VQHqDnF97ZBgO6zvGCauCo,369
|
@@ -304,8 +304,8 @@ agentex/types/messages/batch_update_params.py,sha256=Ug5CThbD49a8j4qucg04OdmVrp_
|
|
304
304
|
agentex/types/messages/batch_update_response.py,sha256=TbSBe6SuPzjXXWSj-nRjT1JHGBooTshHQQDa1AixQA8,278
|
305
305
|
agentex/types/shared/__init__.py,sha256=IKs-Qn5Yja0kFh1G1kDqYZo43qrOu1hSoxlPdN-85dI,149
|
306
306
|
agentex/types/shared/delete_response.py,sha256=8qH3zvQXaOHYQSHyXi7UQxdR4miTzR7V9K4zXVsiUyk,215
|
307
|
-
agentex_sdk-0.4.
|
308
|
-
agentex_sdk-0.4.
|
309
|
-
agentex_sdk-0.4.
|
310
|
-
agentex_sdk-0.4.
|
311
|
-
agentex_sdk-0.4.
|
307
|
+
agentex_sdk-0.4.19.dist-info/METADATA,sha256=wAVGZ27kfYe2_6mzg6KYLTquxKguzFAL-y_C8ZI9azg,15198
|
308
|
+
agentex_sdk-0.4.19.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
309
|
+
agentex_sdk-0.4.19.dist-info/entry_points.txt,sha256=V7vJuMZdF0UlvgX6KiBN7XUvq_cxF5kplcYvc1QlFaQ,62
|
310
|
+
agentex_sdk-0.4.19.dist-info/licenses/LICENSE,sha256=Q1AOx2FtRcMlyMgQJ9eVN2WKPq2mQ33lnB4tvWxabLA,11337
|
311
|
+
agentex_sdk-0.4.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|