aixtools 0.2.11__tar.gz → 0.2.13__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.

Potentially problematic release.


This version of aixtools might be problematic. Click here for more details.

Files changed (95) hide show
  1. {aixtools-0.2.11 → aixtools-0.2.13}/PKG-INFO +1 -1
  2. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/_version.py +3 -3
  3. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/agents/agent.py +22 -12
  4. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/auth/auth.py +9 -1
  5. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/config.py +3 -1
  6. {aixtools-0.2.11 → aixtools-0.2.13}/pyproject.toml +3 -0
  7. {aixtools-0.2.11 → aixtools-0.2.13}/README.md +0 -0
  8. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/config.toml +0 -0
  9. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/bn.json +0 -0
  10. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/en-US.json +0 -0
  11. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/gu.json +0 -0
  12. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/he-IL.json +0 -0
  13. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/hi.json +0 -0
  14. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/ja.json +0 -0
  15. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/kn.json +0 -0
  16. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/ml.json +0 -0
  17. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/mr.json +0 -0
  18. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/nl.json +0 -0
  19. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/ta.json +0 -0
  20. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/te.json +0 -0
  21. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/.chainlit/translations/zh-CN.json +0 -0
  22. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/__init__.py +0 -0
  23. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/a2a/app.py +0 -0
  24. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/a2a/google_sdk/__init__.py +0 -0
  25. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/a2a/google_sdk/pydantic_ai_adapter/agent_executor.py +0 -0
  26. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/a2a/google_sdk/pydantic_ai_adapter/storage.py +0 -0
  27. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/a2a/google_sdk/remote_agent_connection.py +0 -0
  28. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/a2a/google_sdk/utils.py +0 -0
  29. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/a2a/utils.py +0 -0
  30. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/agents/__init__.py +0 -0
  31. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/agents/agent_batch.py +0 -0
  32. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/agents/print_nodes.py +0 -0
  33. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/agents/prompt.py +0 -0
  34. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/app.py +0 -0
  35. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/auth/__init__.py +0 -0
  36. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/chainlit.md +0 -0
  37. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/compliance/__init__.py +0 -0
  38. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/compliance/private_data.py +0 -0
  39. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/context.py +0 -0
  40. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/db/__init__.py +0 -0
  41. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/db/database.py +0 -0
  42. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/db/vector_db.py +0 -0
  43. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/evals/__init__.py +0 -0
  44. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/evals/__main__.py +0 -0
  45. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/evals/dataset.py +0 -0
  46. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/evals/discovery.py +0 -0
  47. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/evals/run_evals.py +0 -0
  48. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/google/client.py +0 -0
  49. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/log_view/__init__.py +0 -0
  50. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/log_view/app.py +0 -0
  51. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/log_view/display.py +0 -0
  52. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/log_view/export.py +0 -0
  53. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/log_view/filters.py +0 -0
  54. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/log_view/log_utils.py +0 -0
  55. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/log_view/node_summary.py +0 -0
  56. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logfilters/__init__.py +0 -0
  57. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logfilters/context_filter.py +0 -0
  58. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logging/__init__.py +0 -0
  59. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logging/log_objects.py +0 -0
  60. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logging/logging_config.py +0 -0
  61. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logging/mcp_log_models.py +0 -0
  62. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logging/mcp_logger.py +0 -0
  63. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logging/model_patch_logging.py +0 -0
  64. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/logging/open_telemetry.py +0 -0
  65. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/mcp/__init__.py +0 -0
  66. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/mcp/client.py +0 -0
  67. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/mcp/example_client.py +0 -0
  68. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/mcp/example_server.py +0 -0
  69. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/mcp/fast_mcp_log.py +0 -0
  70. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/mcp/faulty_mcp.py +0 -0
  71. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/model_patch/model_patch.py +0 -0
  72. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/server/__init__.py +0 -0
  73. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/server/app_mounter.py +0 -0
  74. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/server/path.py +0 -0
  75. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/server/utils.py +0 -0
  76. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/testing/__init__.py +0 -0
  77. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/testing/aix_test_model.py +0 -0
  78. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/testing/mock_tool.py +0 -0
  79. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/testing/model_patch_cache.py +0 -0
  80. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/tools/doctor/__init__.py +0 -0
  81. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/tools/doctor/mcp_tool_doctor.py +0 -0
  82. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/tools/doctor/tool_doctor.py +0 -0
  83. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/tools/doctor/tool_recommendation.py +0 -0
  84. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/__init__.py +0 -0
  85. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/chainlit/cl_agent_show.py +0 -0
  86. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/chainlit/cl_utils.py +0 -0
  87. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/config_util.py +0 -0
  88. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/enum_with_description.py +0 -0
  89. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/files.py +0 -0
  90. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/persisted_dict.py +0 -0
  91. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/utils/utils.py +0 -0
  92. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/vault/__init__.py +0 -0
  93. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools/vault/vault.py +0 -0
  94. {aixtools-0.2.11 → aixtools-0.2.13}/aixtools.egg-info/SOURCES.txt +0 -0
  95. {aixtools-0.2.11 → aixtools-0.2.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aixtools
3
- Version: 0.2.11
3
+ Version: 0.2.13
4
4
  Summary: Tools for AI exploration and debugging
5
5
  Requires-Python: >=3.11.2
6
6
  Description-Content-Type: text/markdown
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.2.11'
32
- __version_tuple__ = version_tuple = (0, 2, 11)
31
+ __version__ = version = '0.2.13'
32
+ __version_tuple__ = version_tuple = (0, 2, 13)
33
33
 
34
- __commit_id__ = commit_id = 'g66be32dcf'
34
+ __commit_id__ = commit_id = 'gb809b4cc2'
@@ -51,17 +51,17 @@ def _get_model_bedrock(model_name=BEDROCK_MODEL_NAME, aws_region=AWS_REGION):
51
51
  return BedrockConverseModel(model_name=model_name, provider=provider)
52
52
 
53
53
 
54
- def _get_model_ollama(model_name=OLLAMA_MODEL_NAME, ollama_url=OLLAMA_URL):
54
+ def _get_model_ollama(model_name=OLLAMA_MODEL_NAME, ollama_url=OLLAMA_URL, http_client=None):
55
55
  assert ollama_url, "OLLAMA_URL is not set"
56
56
  assert model_name, "Model name is not set"
57
- provider = OpenAIProvider(base_url=ollama_url)
57
+ provider = OpenAIProvider(base_url=ollama_url, http_client=http_client)
58
58
  return OpenAIChatModel(model_name=model_name, provider=provider)
59
59
 
60
60
 
61
- def _get_model_openai(model_name=OPENAI_MODEL_NAME, openai_api_key=OPENAI_API_KEY):
61
+ def _get_model_openai(model_name=OPENAI_MODEL_NAME, openai_api_key=OPENAI_API_KEY, http_client=None):
62
62
  assert openai_api_key, "OPENAI_API_KEY is not set"
63
63
  assert model_name, "Model name is not set"
64
- provider = OpenAIProvider(api_key=openai_api_key)
64
+ provider = OpenAIProvider(api_key=openai_api_key, http_client=http_client)
65
65
  return OpenAIChatModel(model_name=model_name, provider=provider)
66
66
 
67
67
 
@@ -76,22 +76,27 @@ def _get_model_openai_azure(
76
76
  assert azure_openai_api_version, "AZURE_OPENAI_API_VERSION is not set"
77
77
  assert model_name, "Model name is not set"
78
78
  client = AsyncAzureOpenAI(
79
- azure_endpoint=azure_openai_endpoint, api_version=azure_openai_api_version, api_key=azure_openai_api_key
79
+ azure_endpoint=azure_openai_endpoint,
80
+ api_version=azure_openai_api_version,
81
+ api_key=azure_openai_api_key,
80
82
  )
81
83
  return OpenAIChatModel(model_name=model_name, provider=OpenAIProvider(openai_client=client))
82
84
 
83
85
 
84
86
  def _get_model_open_router(
85
- model_name=OPENROUTER_MODEL_NAME, openrouter_api_url=OPENROUTER_API_URL, openrouter_api_key=OPENROUTER_API_KEY
87
+ model_name=OPENROUTER_MODEL_NAME,
88
+ openrouter_api_url=OPENROUTER_API_URL,
89
+ openrouter_api_key=OPENROUTER_API_KEY,
90
+ http_client=None,
86
91
  ):
87
92
  assert openrouter_api_url, "OPENROUTER_API_URL is not set"
88
93
  assert openrouter_api_key, "OPENROUTER_API_KEY is not set"
89
94
  assert model_name, "Model name is not set, missing 'OPENROUTER_MODEL_NAME' environment variable?"
90
- provider = OpenAIProvider(base_url=openrouter_api_url, api_key=openrouter_api_key)
95
+ provider = OpenAIProvider(base_url=openrouter_api_url, api_key=openrouter_api_key, http_client=http_client)
91
96
  return OpenAIChatModel(model_name, provider=provider)
92
97
 
93
98
 
94
- def get_model(model_family=MODEL_FAMILY, model_name=None, **kwargs):
99
+ def get_model(model_family=MODEL_FAMILY, model_name=None, http_client=None, **kwargs):
95
100
  """Create and return appropriate model instance based on specified family and name."""
96
101
  assert model_family is not None and model_family != "", f"Model family '{model_family}' is not set"
97
102
  match model_family:
@@ -100,11 +105,13 @@ def get_model(model_family=MODEL_FAMILY, model_name=None, **kwargs):
100
105
  case "bedrock":
101
106
  return _get_model_bedrock(model_name=model_name or BEDROCK_MODEL_NAME, **kwargs)
102
107
  case "ollama":
103
- return _get_model_ollama(model_name=model_name or OLLAMA_MODEL_NAME, **kwargs)
108
+ return _get_model_ollama(model_name=model_name or OLLAMA_MODEL_NAME, http_client=http_client, **kwargs)
104
109
  case "openai":
105
- return _get_model_openai(model_name=model_name or OPENAI_MODEL_NAME, **kwargs)
110
+ return _get_model_openai(model_name=model_name or OPENAI_MODEL_NAME, http_client=http_client, **kwargs)
106
111
  case "openrouter":
107
- return _get_model_open_router(model_name=model_name or OPENROUTER_MODEL_NAME, **kwargs)
112
+ return _get_model_open_router(
113
+ model_name=model_name or OPENROUTER_MODEL_NAME, http_client=http_client, **kwargs
114
+ )
108
115
  case _:
109
116
  raise ValueError(f"Model family '{model_family}' not supported")
110
117
 
@@ -119,12 +126,15 @@ def get_agent( # noqa: PLR0913, pylint: disable=too-many-arguments,too-many-pos
119
126
  model_settings=None,
120
127
  output_type: Any = str,
121
128
  deps_type=NoneType,
129
+ http_client=None,
122
130
  ) -> Agent:
123
131
  """Get a PydanticAI agent"""
124
132
  if model_settings is None:
125
133
  model_settings = ModelSettings(timeout=MODEL_TIMEOUT)
126
134
  if model is None:
127
- model = get_model()
135
+ model = get_model(
136
+ http_client=http_client,
137
+ )
128
138
  agent = Agent(
129
139
  model=model,
130
140
  output_type=output_type,
@@ -16,6 +16,7 @@ from mcp.server.auth.provider import (
16
16
  from aixtools.utils import config
17
17
 
18
18
  logger = logging.getLogger(__name__)
19
+ TEST_CLIENT = "test-client"
19
20
 
20
21
 
21
22
  class AuthTokenErrorCode(str, enum.Enum):
@@ -163,8 +164,15 @@ class AccessTokenAuthProvider(AuthProvider):
163
164
 
164
165
  async def verify_token(self, token: str) -> AccessToken:
165
166
  """Verify the access token and return an AccessToken object."""
166
-
167
167
  logger.info("Received verify token request")
168
+ test_token = config.AUTH_TEST_TOKEN
169
+
170
+ # check if the token is a test token
171
+ # this is used for integration test run
172
+ if test_token and token == test_token:
173
+ logger.info("Using test token:%s", test_token)
174
+ return AccessToken(token=token, client_id=TEST_CLIENT, scopes=[], expires_at=None)
175
+
168
176
  claims = self.token_verifier.verify(token)
169
177
  scopes = claims.get("scp", "")
170
178
  self.token_verifier.authorize_claims(claims, self.app_scope)
@@ -124,7 +124,7 @@ GOOGLE_CLOUD_LOCATION = get_variable_env("GOOGLE_CLOUD_LOCATION", True)
124
124
  # vault parameters.
125
125
  VAULT_ADDRESS = get_variable_env("VAULT_ADDRESS", default="http://localhost:8200")
126
126
  VAULT_TOKEN = get_variable_env("VAULT_TOKEN", allow_empty=True)
127
- VAULT_ENV = get_variable_env("ENV", allow_empty=True)
127
+ VAULT_ENV = get_variable_env("VAULT_ENV", allow_empty=True)
128
128
  VAULT_MOUNT_POINT = get_variable_env("VAULT_MOUNT_POINT", allow_empty=True)
129
129
  VAULT_PATH_PREFIX = get_variable_env("VAULT_PATH_PREFIX", allow_empty=True)
130
130
 
@@ -142,3 +142,5 @@ APP_AUTHORIZED_GROUPS = get_variable_env("APP_AUTHORIZED_GROUPS", allow_empty=Tr
142
142
  # used to skip authorization in local tests if required.
143
143
  SKIP_MCP_AUTHORIZATION = str2bool(get_variable_env("SKIP_MCP_AUTHORIZATION", True, False))
144
144
  APP_DEFAULT_SCOPE = get_variable_env("APP_DEFAULT_SCOPE", allow_empty=True)
145
+
146
+ AUTH_TEST_TOKEN = get_variable_env("AUTH_TEST_TOKEN", allow_empty=True)
@@ -71,3 +71,6 @@ ignore = ["_version.py"]
71
71
  [tool.setuptools_scm]
72
72
  write_to = "aixtools/_version.py"
73
73
  version_scheme = "release-branch-semver"
74
+
75
+ [tool.pytest.ini_options]
76
+ asyncio_mode = "auto"
File without changes
File without changes
File without changes
File without changes
File without changes