acp-sdk 0.9.0__tar.gz → 0.9.1__tar.gz

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.
Files changed (50) hide show
  1. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/PKG-INFO +1 -1
  2. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/pyproject.toml +1 -1
  3. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/client/client.py +1 -5
  4. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/app.py +0 -3
  5. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/server.py +4 -2
  6. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/telemetry.py +6 -2
  7. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/.gitignore +0 -0
  8. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/.python-version +0 -0
  9. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/README.md +0 -0
  10. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/docs/.gitignore +0 -0
  11. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/docs/Makefile +0 -0
  12. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/docs/conf.py +0 -0
  13. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/docs/index.rst +0 -0
  14. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/docs/make.bat +0 -0
  15. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/pytest.ini +0 -0
  16. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/__init__.py +0 -0
  17. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/client/__init__.py +0 -0
  18. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/client/types.py +0 -0
  19. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/client/utils.py +0 -0
  20. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/instrumentation.py +0 -0
  21. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/models/__init__.py +0 -0
  22. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/models/errors.py +0 -0
  23. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/models/models.py +0 -0
  24. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/models/schemas.py +0 -0
  25. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/py.typed +0 -0
  26. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/__init__.py +0 -0
  27. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/agent.py +0 -0
  28. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/bundle.py +0 -0
  29. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/context.py +0 -0
  30. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/errors.py +0 -0
  31. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/logging.py +0 -0
  32. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/session.py +0 -0
  33. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/types.py +0 -0
  34. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/server/utils.py +0 -0
  35. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/src/acp_sdk/version.py +0 -0
  36. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/conftest.py +0 -0
  37. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/__init__.py +0 -0
  38. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/config.py +0 -0
  39. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/fixtures/__init__.py +0 -0
  40. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/fixtures/client.py +0 -0
  41. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/fixtures/server.py +0 -0
  42. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/test_suites/__init__.py +0 -0
  43. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/test_suites/test_discovery.py +0 -0
  44. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/e2e/test_suites/test_runs.py +0 -0
  45. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/unit/client/test_client.py +0 -0
  46. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/unit/client/test_utils.py +0 -0
  47. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/unit/models/__init__.py +0 -0
  48. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/unit/models/test_models.py +0 -0
  49. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/unit/server/__init__.py +0 -0
  50. {acp_sdk-0.9.0 → acp_sdk-0.9.1}/tests/unit/server/test_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: acp-sdk
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: Agent Communication Protocol SDK
5
5
  Author: IBM Corp.
6
6
  Maintainer-email: Tomas Pilar <thomas7pilar@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "acp-sdk"
3
- version = "0.9.0"
3
+ version = "0.9.1"
4
4
  description = "Agent Communication Protocol SDK"
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
@@ -8,7 +8,6 @@ from typing import Self
8
8
 
9
9
  import httpx
10
10
  from httpx_sse import EventSource, aconnect_sse
11
- from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
12
11
  from pydantic import TypeAdapter
13
12
 
14
13
  from acp_sdk.client.types import Input
@@ -44,7 +43,6 @@ class Client:
44
43
  *,
45
44
  session_id: SessionId | None = None,
46
45
  client: httpx.AsyncClient | None = None,
47
- instrument: bool = True,
48
46
  auth: httpx._types.AuthTypes | None = None,
49
47
  params: httpx._types.QueryParamTypes | None = None,
50
48
  headers: httpx._types.HeaderTypes | None = None,
@@ -85,8 +83,6 @@ class Client:
85
83
  transport=transport,
86
84
  trust_env=trust_env,
87
85
  )
88
- if instrument:
89
- HTTPXClientInstrumentor.instrument_client(self._client)
90
86
 
91
87
  @property
92
88
  def client(self) -> httpx.AsyncClient:
@@ -108,7 +104,7 @@ class Client:
108
104
  async def session(self, session_id: SessionId | None = None) -> AsyncGenerator[Self]:
109
105
  session_id = session_id or uuid.uuid4()
110
106
  with get_tracer().start_as_current_span("session", attributes={"acp.session": str(session_id)}):
111
- yield Client(client=self._client, session_id=session_id, instrument=False)
107
+ yield Client(client=self._client, session_id=session_id)
112
108
 
113
109
  async def agents(self) -> AsyncIterator[Agent]:
114
110
  response = await self._client.get("/agents")
@@ -9,7 +9,6 @@ from fastapi import Depends, FastAPI, HTTPException, status
9
9
  from fastapi.applications import AppType, Lifespan
10
10
  from fastapi.encoders import jsonable_encoder
11
11
  from fastapi.responses import JSONResponse, StreamingResponse
12
- from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
13
12
 
14
13
  from acp_sdk.models import (
15
14
  Agent as AgentModel,
@@ -75,8 +74,6 @@ def create_app(
75
74
  dependencies=dependencies,
76
75
  )
77
76
 
78
- FastAPIInstrumentor.instrument_app(app)
79
-
80
77
  agents: dict[AgentName, Agent] = {agent.name: agent for agent in agents}
81
78
  runs: TTLCache[RunId, RunBundle] = TTLCache(maxsize=run_limit, ttl=run_ttl, timer=datetime.now)
82
79
  sessions: TTLCache[SessionId, Session] = TTLCache(maxsize=run_limit, ttl=run_ttl, timer=datetime.now)
@@ -118,13 +118,15 @@ class Server:
118
118
 
119
119
  import uvicorn
120
120
 
121
+ app = create_app(*self.agents, lifespan=self.lifespan, run_limit=run_limit, run_ttl=run_ttl)
122
+
121
123
  if configure_logger:
122
124
  configure_logger_func()
123
125
  if configure_telemetry:
124
- configure_telemetry_func()
126
+ configure_telemetry_func(app)
125
127
 
126
128
  config = uvicorn.Config(
127
- create_app(*self.agents, lifespan=self.lifespan, run_limit=run_limit, run_ttl=run_ttl),
129
+ app,
128
130
  host,
129
131
  port,
130
132
  uds,
@@ -1,9 +1,11 @@
1
1
  import logging
2
2
 
3
+ from fastapi import FastAPI
3
4
  from opentelemetry import metrics, trace
4
5
  from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter
5
6
  from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
6
7
  from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
8
+ from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
7
9
  from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
8
10
  from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
9
11
  from opentelemetry.sdk.metrics import MeterProvider
@@ -22,8 +24,10 @@ from acp_sdk.version import __version__
22
24
  root_logger = logging.getLogger()
23
25
 
24
26
 
25
- def configure_telemetry() -> None:
26
- """Utility that configures opentelemetry with OTLP exporter"""
27
+ def configure_telemetry(app: FastAPI) -> None:
28
+ """Utility that configures opentelemetry with OTLP exporter and FastAPI instrumentation"""
29
+
30
+ FastAPIInstrumentor.instrument_app(app)
27
31
 
28
32
  resource = Resource(
29
33
  attributes={
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes