agentenv-framework-protocol 0.1.341__tar.gz → 0.1.342__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 (47) hide show
  1. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/PKG-INFO +4 -3
  2. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/README.md +3 -2
  3. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/examples/reference_model.py +6 -1
  4. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/pyproject.toml +1 -1
  5. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_a2a_agent_examples.py +17 -2
  6. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/.gitignore +0 -0
  7. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/LICENSE +0 -0
  8. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/NOTICE +0 -0
  9. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/THIRD_PARTY_NOTICES.md +0 -0
  10. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/examples/__init__.py +0 -0
  11. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/examples/advanced_agent.py +0 -0
  12. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/examples/basic_agent.py +0 -0
  13. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/examples/custom_extensions_agent.py +0 -0
  14. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/examples/multimodal_agent.py +0 -0
  15. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/examples/streaming_agent.py +0 -0
  16. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/__init__.py +0 -0
  17. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/__init__.py +0 -0
  18. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +0 -0
  19. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
  20. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
  21. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/framework.py +0 -0
  22. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
  23. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
  24. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
  25. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/a2a_agent/tasks/v1.py +0 -0
  26. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/agent_env_environment.py +0 -0
  27. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/client.py +0 -0
  28. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/manifest.py +0 -0
  29. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/preflight.py +0 -0
  30. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/tool_client.py +0 -0
  31. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/tool_context.py +0 -0
  32. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/transfers.py +0 -0
  33. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/src/agentenv_protocol/types.py +0 -0
  34. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_a2a_agent.py +0 -0
  35. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_a2a_object_transfers.py +0 -0
  36. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_a2a_staging.py +0 -0
  37. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_a2a_trajectory_log.py +0 -0
  38. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_agent_env_environment.py +0 -0
  39. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_client.py +0 -0
  40. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_data_objects.py +0 -0
  41. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_intake.py +0 -0
  42. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_manifest.py +0 -0
  43. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_preflight.py +0 -0
  44. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_tool_client.py +0 -0
  45. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_tool_context.py +0 -0
  46. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_tool_context_fastmcp.py +0 -0
  47. {agentenv_framework_protocol-0.1.341 → agentenv_framework_protocol-0.1.342}/tests/test_tool_context_injection.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentenv-framework-protocol
3
- Version: 0.1.341
3
+ Version: 0.1.342
4
4
  Summary: Open data-plane protocol and server SDK for agent environments.
5
5
  Project-URL: Homepage, https://www.agentenvframework.com
6
6
  Project-URL: Documentation, https://www.agentenvframework.com/docs
@@ -724,8 +724,9 @@ multi-operation custom extensions, and advanced ASGI-lifespan plus
724
724
  common SDK-operation override hooks.
725
725
 
726
726
  The agent examples make real OpenAI-compatible model calls. Set
727
- `LITELLM_API_KEY` and, when needed, `LITELLM_BASE_URL`; their typed agent config
728
- selects the model and system prompt for each deployment. Tests inject a fake
727
+ `LITELLM_API_KEY` and, when needed, `LITELLM_BASE_URL`; they also send the headers in
728
+ `LITELLM_EXTRA_HEADERS`, a JSON object AgentEnv sets when the endpoint needs any. Their typed
729
+ agent config selects the model and system prompt for each deployment. Tests inject a fake
729
730
  model client, so the example suite remains offline and deterministic.
730
731
 
731
732
  ### Object transfer
@@ -679,8 +679,9 @@ multi-operation custom extensions, and advanced ASGI-lifespan plus
679
679
  common SDK-operation override hooks.
680
680
 
681
681
  The agent examples make real OpenAI-compatible model calls. Set
682
- `LITELLM_API_KEY` and, when needed, `LITELLM_BASE_URL`; their typed agent config
683
- selects the model and system prompt for each deployment. Tests inject a fake
682
+ `LITELLM_API_KEY` and, when needed, `LITELLM_BASE_URL`; they also send the headers in
683
+ `LITELLM_EXTRA_HEADERS`, a JSON object AgentEnv sets when the endpoint needs any. Their typed
684
+ agent config selects the model and system prompt for each deployment. Tests inject a fake
684
685
  model client, so the example suite remains offline and deterministic.
685
686
 
686
687
  ### Object transfer
@@ -42,13 +42,18 @@ class OpenAICompatibleModel:
42
42
  raise RuntimeError(
43
43
  "LITELLM_BASE_URL must be set before running the agent"
44
44
  )
45
+ # The endpoint's headers are for the endpoint AgentEnv configured, never one this client was pointed at.
46
+ configured = os.getenv("LITELLM_BASE_URL") or ""
47
+ headers = (json.loads(os.getenv("LITELLM_EXTRA_HEADERS") or "{}")
48
+ if base_url.rstrip("/") == configured.rstrip("/") else {})
45
49
  base_url = base_url.rstrip("/")
46
50
  endpoint = (
47
51
  f"{base_url}/chat/completions"
48
52
  if base_url.endswith("/v1")
49
53
  else f"{base_url}/v1/chat/completions"
50
54
  )
51
- return endpoint, {"Authorization": f"Bearer {api_key}"}
55
+ own = {k: v for k, v in headers.items() if k.lower() != "authorization"}
56
+ return endpoint, {**own, "Authorization": f"Bearer {api_key}"}
52
57
 
53
58
  async def complete(
54
59
  self,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentenv-framework-protocol"
3
- version = "0.1.341"
3
+ version = "0.1.342"
4
4
  description = "Open data-plane protocol and server SDK for agent environments."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -64,9 +64,24 @@ StreamingAgent = _streaming.StreamingAgent
64
64
 
65
65
 
66
66
  @pytest.mark.asyncio
67
- async def test_reference_model_forwards_generic_metadata(
67
+ @pytest.mark.parametrize("endpoint_headers, configured_url, sent_headers", [
68
+ (None, "https://models.example/v1", {"Authorization": "Bearer request-scoped-key"}),
69
+ ('{"X-Bill-To": "acme", "authorization": "Bearer theirs"}', "https://models.example/v1",
70
+ {"X-Bill-To": "acme", "Authorization": "Bearer request-scoped-key"}),
71
+ ('{"X-Bill-To": "acme"}', "https://models.example/v1/", {"X-Bill-To": "acme", "Authorization": "Bearer request-scoped-key"}),
72
+ ('{"X-Bill-To": "acme"}', "https://configured.example/v1", {"Authorization": "Bearer request-scoped-key"}),
73
+ ], ids=["no-endpoint-headers", "endpoint-headers", "trailing-slash", "another-endpoint"])
74
+ async def test_reference_model_forwards_generic_metadata_and_the_endpoints_headers(
68
75
  monkeypatch: pytest.MonkeyPatch,
76
+ endpoint_headers: str | None,
77
+ configured_url: str,
78
+ sent_headers: dict[str, str],
69
79
  ) -> None:
80
+ monkeypatch.setenv("LITELLM_BASE_URL", configured_url)
81
+ if endpoint_headers is None:
82
+ monkeypatch.delenv("LITELLM_EXTRA_HEADERS", raising=False)
83
+ else:
84
+ monkeypatch.setenv("LITELLM_EXTRA_HEADERS", endpoint_headers)
70
85
  captured: dict[str, Any] = {}
71
86
  class Response:
72
87
  def raise_for_status(self) -> None:
@@ -107,7 +122,7 @@ async def test_reference_model_forwards_generic_metadata(
107
122
  "client": {"timeout": 120},
108
123
  "request": {
109
124
  "url": "https://models.example/v1/chat/completions",
110
- "headers": {"Authorization": "Bearer request-scoped-key"},
125
+ "headers": sent_headers,
111
126
  "json": {
112
127
  "model": "test-model",
113
128
  "messages": [{"role": "user", "content": "hello"}],