agenta 0.59.7__py3-none-any.whl → 0.59.9__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.

Potentially problematic release.


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

agenta/sdk/assets.py CHANGED
@@ -1,5 +1,5 @@
1
1
  supported_llm_models = {
2
- "Anthropic": [
2
+ "anthropic": [
3
3
  "anthropic/claude-sonnet-4-5",
4
4
  "anthropic/claude-haiku-4-5",
5
5
  "anthropic/claude-opus-4-1",
@@ -15,18 +15,18 @@ supported_llm_models = {
15
15
  "anthropic/claude-2.1",
16
16
  "anthropic/claude-2",
17
17
  ],
18
- "Cohere": [
18
+ "cohere": [
19
19
  "cohere/command-light",
20
20
  "cohere/command-r-plus",
21
21
  "cohere/command-nightly",
22
22
  ],
23
- "DeepInfra": [
23
+ "deepinfra": [
24
24
  "deepinfra/meta-llama/Llama-2-70b-chat-hf",
25
25
  "deepinfra/meta-llama/Llama-2-13b-chat-hf",
26
26
  "deepinfra/codellama/CodeLlama-34b-Instruct-hf",
27
27
  "deepinfra/mistralai/Mistral-7B-Instruct-v0.1",
28
28
  ],
29
- "Gemini": [
29
+ "gemini": [
30
30
  "gemini/gemini-2.5-pro",
31
31
  "gemini/gemini-2.5-pro-preview-05-06",
32
32
  "gemini/gemini-2.5-flash",
@@ -40,7 +40,7 @@ supported_llm_models = {
40
40
  "gemini/gemini-2.0-flash-lite",
41
41
  "gemini/gemini-2.0-flash-lite-preview-02-05",
42
42
  ],
43
- "Groq": [
43
+ "groq": [
44
44
  "groq/deepseek-r1-distill-llama-70b",
45
45
  "groq/deepseek-r1-distill-llama-70b-specdec",
46
46
  "groq/gemma2-9b-it",
@@ -56,13 +56,13 @@ supported_llm_models = {
56
56
  "groq/llama3-8b-8192",
57
57
  "groq/mixtral-8x7b-32768",
58
58
  ],
59
- "Mistral": [
59
+ "mistral": [
60
60
  "mistral/mistral-tiny",
61
61
  "mistral/mistral-small",
62
62
  "mistral/mistral-medium",
63
63
  "mistral/mistral-large-latest",
64
64
  ],
65
- "OpenAI": [
65
+ "openai": [
66
66
  "gpt-5",
67
67
  "gpt-5-mini",
68
68
  "gpt-5-nano",
@@ -78,7 +78,7 @@ supported_llm_models = {
78
78
  "gpt-4.1-nano",
79
79
  "o4-mini",
80
80
  ],
81
- "OpenRouter": [
81
+ "openrouter": [
82
82
  "openrouter/qwen/qwen3-235b-a22b",
83
83
  "openrouter/qwen/qwen3-32b",
84
84
  "openrouter/qwen/qwen3-30b-a3b",
@@ -148,13 +148,13 @@ supported_llm_models = {
148
148
  "openrouter/google/gemini-2.0-flash-001",
149
149
  "openrouter/perplexity/sonar-reasoning",
150
150
  ],
151
- "Perplexity AI": [
151
+ "perplexity": [
152
152
  "perplexity/sonar",
153
153
  "perplexity/sonar-pro",
154
154
  "perplexity/sonar-reasoning",
155
155
  "perplexity/sonar-reasoning-pro",
156
156
  ],
157
- "togetherai": [
157
+ "together_ai": [
158
158
  "together_ai/deepseek-ai/DeepSeek-R1",
159
159
  "together_ai/deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
160
160
  "together_ai/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
@@ -119,11 +119,17 @@ class SecretsManager:
119
119
  # The reason is that custom providers are in fact openai compatible providers
120
120
  # They need to be passed in litellm as openai/modelname
121
121
 
122
- if "custom" in model:
123
- modified_model = model.replace(f"{provider_slug}/custom/", "openai/")
124
- return modified_model.replace(f"{provider_slug}/", "")
122
+ modified_model = model
125
123
 
126
- return model.replace(f"{provider_slug}/", "")
124
+ if "custom" in modified_model:
125
+ modified_model = modified_model.replace(
126
+ f"{provider_slug}/custom/", "openai/"
127
+ )
128
+
129
+ if provider_slug:
130
+ modified_model = modified_model.replace(f"{provider_slug}/", "")
131
+
132
+ return modified_model
127
133
 
128
134
  @staticmethod
129
135
  def get_provider_settings(model: str) -> Optional[Dict]:
@@ -137,6 +143,8 @@ class SecretsManager:
137
143
  Dict: A dictionary containing all parameters needed for litellm.completion
138
144
  """
139
145
 
146
+ request_provider_model = model
147
+
140
148
  # STEP 1: get vault secrets from route context and transform it
141
149
  secrets = SecretsManager.get_from_route()
142
150
  if not secrets:
@@ -146,11 +154,11 @@ class SecretsManager:
146
154
  secrets = SecretsManager._parse_secrets(secrets=secrets)
147
155
 
148
156
  # STEP 2: check model exists in supported standard models
149
- provider = _standard_providers.get(model)
157
+ provider = _standard_providers.get(request_provider_model)
150
158
  if not provider:
151
159
  # check and get provider kind if model exists in custom provider models
152
160
  provider = SecretsManager._custom_providers_get(
153
- model=model,
161
+ model=request_provider_model,
154
162
  secrets=secrets,
155
163
  )
156
164
 
@@ -159,16 +167,19 @@ class SecretsManager:
159
167
  return None
160
168
 
161
169
  # STEP 2c: get litellm compatible model
162
- provider_slug = SecretsManager._custom_provider_slug_get(
163
- model=model, secrets=secrets
170
+ request_provider_slug = (
171
+ SecretsManager._custom_provider_slug_get(
172
+ model=request_provider_model, secrets=secrets
173
+ )
174
+ or ""
164
175
  )
165
- model = SecretsManager._get_compatible_model(
166
- model=model, provider_slug=provider_slug
176
+ compatible_provider_model = SecretsManager._get_compatible_model(
177
+ model=request_provider_model, provider_slug=request_provider_slug
167
178
  )
168
179
 
169
180
  # STEP 3: initialize provider settings and simplify provider name
170
- provider_settings = {"model": model}
171
- provider_name = re.sub(
181
+ provider_settings = dict(model=compatible_provider_model)
182
+ request_provider_kind = re.sub(
172
183
  r"[\s-]+", "", provider.lower()
173
184
  ) # normalizing other special characters too (azure-openai)
174
185
 
@@ -180,9 +191,9 @@ class SecretsManager:
180
191
  # i). Extract API key if present
181
192
  # (for standard models -- openai/anthropic/gemini, etc)
182
193
  if secret.get("kind") == "provider_key":
183
- provider_kind = secret_data.get("kind", "")
194
+ secret_provider_kind = secret_data.get("kind", "")
184
195
 
185
- if provider_kind == provider_name:
196
+ if request_provider_kind == secret_provider_kind:
186
197
  if "key" in provider_info:
187
198
  provider_settings["api_key"] = provider_info["key"]
188
199
  continue
@@ -190,13 +201,20 @@ class SecretsManager:
190
201
  # ii). Extract Credentials if present
191
202
  # (for custom providers -- aws bedrock/sagemaker, vertex_ai, etc)
192
203
  elif secret.get("kind") == "custom_provider":
193
- provider_kind = provider_info.get("kind", "").lower().replace(" ", "")
194
- provider_slug = secret_data.get("provider_slug", "")
195
- provider_extras = provider_info.get("extras", {})
196
-
197
- if provider_kind == provider_name or provider_slug == provider_name:
198
- if provider_extras:
199
- provider_settings.update(provider_extras)
204
+ secret_provider_kind = (
205
+ provider_info.get("kind", "").lower().replace(" ", "")
206
+ )
207
+ secret_provider_slug = secret_data.get("provider_slug", "")
208
+ secret_provider_models = secret_data.get("models", "")
209
+ secret_provider_extras = provider_info.get("extras", {})
210
+
211
+ if (
212
+ request_provider_kind == secret_provider_kind
213
+ and request_provider_slug == secret_provider_slug
214
+ and request_provider_model in secret_provider_models
215
+ ):
216
+ if secret_provider_extras:
217
+ provider_settings.update(secret_provider_extras)
200
218
  continue
201
219
 
202
220
  return provider_settings
@@ -85,7 +85,7 @@ class VaultMiddleware(BaseHTTPMiddleware):
85
85
  continue
86
86
 
87
87
  secret = SecretDTO(
88
- kind="provider_kind", # type: ignore
88
+ kind="provider_key", # type: ignore
89
89
  data=StandardProviderDTO(
90
90
  kind=provider,
91
91
  provider=StandardProviderSettingsDTO(key=key),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agenta
3
- Version: 0.59.7
3
+ Version: 0.59.9
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Keywords: LLMOps,LLM,evaluation,prompt engineering
6
6
  Author: Mahmoud Mabrouk
@@ -307,7 +307,7 @@ agenta/config.py,sha256=0VrTqduB4g8Mt_Ll7ffFcEjKF5qjTUIxmUtTPW2ygWw,653
307
307
  agenta/config.toml,sha256=sIORbhnyct2R9lJrquxhNL4pHul3O0R7iaipCoja5MY,193
308
308
  agenta/sdk/__init__.py,sha256=6LWzIVeXpkBKgjIXyOFOJwSDDcAf9JC_3kmxaBxjB_w,2170
309
309
  agenta/sdk/agenta_init.py,sha256=Jkfm5Fs5qy1gMY_AWiMhr_EnvVBddNRqYb8GtN19kkc,6610
310
- agenta/sdk/assets.py,sha256=Np_zZbnRUSws-NxlrW1mMLyJPGM8Y-uKN6Q8Qd1dW_o,8643
310
+ agenta/sdk/assets.py,sha256=GRnOTMcNqMNCVtOviD3xnuXrEM8k1j3i9-U0ZjHv6o4,8641
311
311
  agenta/sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
312
312
  agenta/sdk/context/running.py,sha256=3gEuUdQrJwcuN93MlXFZ6aHXNxUW6dUk_EudgaxOkCU,907
313
313
  agenta/sdk/context/serving.py,sha256=f0Iq8Sv_CBJF7838tDecy_89K6HI7k6joWBkWHTM7yE,598
@@ -324,7 +324,7 @@ agenta/sdk/managers/__init__.py,sha256=SN-LRwG0pRRDV3u2Q4JiiSTigN3-mYpzGNM35RzT4
324
324
  agenta/sdk/managers/apps.py,sha256=BeAlTJlOOM0Wh_XWgjve65Mt-LwFgib_swu-1wvGQi4,2250
325
325
  agenta/sdk/managers/config.py,sha256=yyFxjZVf3_XfNAkZpl-qWzljYz4XB8LgPYc55JXEwG0,7494
326
326
  agenta/sdk/managers/deployment.py,sha256=SEokjZeh6n7HRKZ92Y0WncdG49hIFx-Z3B3HAl2kmUg,1174
327
- agenta/sdk/managers/secrets.py,sha256=3fd-WKJo2vs8dA_Nk4NLqf8RYG9FcvFTrnSmKBQqSm0,7459
327
+ agenta/sdk/managers/secrets.py,sha256=pD0WIYfCz-OvSk7RGubHwj7mxAMREZhkF-CluAta_XU,8107
328
328
  agenta/sdk/managers/shared.py,sha256=kI3w74E4rS3YDORG2e-_r0Pz5KslTRzRBK7vgyOeaJA,21559
329
329
  agenta/sdk/managers/variant.py,sha256=A5ga3mq3b0weUTXa9HO72MGaspthGcu1uK9K5OnP738,4172
330
330
  agenta/sdk/managers/vault.py,sha256=tOJsRWSEpmNT_ysWVcK5KQMdQO4pwiK90H3rsr9BUbg,337
@@ -338,7 +338,7 @@ agenta/sdk/middleware/flags.py,sha256=okku9RBmcD4Qka8XIsVqtroMDg-9IXevUwDiAA9whJ
338
338
  agenta/sdk/middleware/inline.py,sha256=ee8E4XBGcRSrHTvblqX1yRXuTN_sxLm7lY1jnywrBG8,901
339
339
  agenta/sdk/middleware/mock.py,sha256=bCUN9iJBxePyN9MBwBpJs-_iCNkUQeUjIIu3WElS1oQ,759
340
340
  agenta/sdk/middleware/otel.py,sha256=lHzhGUv4fq2RPuTPH2keJ16v-_cBUrLrTqWzHUmEVdI,1041
341
- agenta/sdk/middleware/vault.py,sha256=sF2CmWQdCvXJcmZppT4duV0KgqHW4c4wg4Fs_i1SvNs,4059
341
+ agenta/sdk/middleware/vault.py,sha256=HPiEV7mqq96haUG_fzaI_3QphbS-U80kduH2PPpIyHA,4058
342
342
  agenta/sdk/router.py,sha256=mOguvtOwl2wmyAgOuWTsf98pQwpNiUILKIo67W_hR3A,119
343
343
  agenta/sdk/tracing/__init__.py,sha256=rQNe5-zT5Kt7_CDhq-lnUIi1EYTBVzVf_MbfcIxVD98,41
344
344
  agenta/sdk/tracing/attributes.py,sha256=Brqle9hGV3DaEJjeYCBq7MDlbvHMAIwmkUj2Lni8dF4,5563
@@ -366,6 +366,6 @@ agenta/sdk/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
366
366
  agenta/sdk/workflows/registry.py,sha256=4FRSeU4njMmP6xFCIteF5f_W6NVlqFTx1AM7hsaGAQk,975
367
367
  agenta/sdk/workflows/types.py,sha256=SjYeT8FWVgwaIIC8sI3fRjKERLEA_oxuBGvYSaFqNg8,11720
368
368
  agenta/sdk/workflows/utils.py,sha256=ILfY8DSBWLrdWIuKg6mq7rANwKiiY6sxEeFiBFhjLYM,413
369
- agenta-0.59.7.dist-info/METADATA,sha256=2uIEfhZCpN4AKWkMHiku3SLW64jWheVmOmjuO26_x4Q,31792
370
- agenta-0.59.7.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
371
- agenta-0.59.7.dist-info/RECORD,,
369
+ agenta-0.59.9.dist-info/METADATA,sha256=A-GxoCEoeZ_1nwo38s1ChmRQ2kUue7ECCDhjTMTk61k,31792
370
+ agenta-0.59.9.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
371
+ agenta-0.59.9.dist-info/RECORD,,