agenta 0.32.0__py3-none-any.whl → 0.32.0a2__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/__init__.py CHANGED
@@ -5,10 +5,10 @@ from .sdk.utils.preinit import PreInitObject
5
5
  import agenta.client.backend.types as client_types # pylint: disable=wrong-import-order
6
6
 
7
7
  from .sdk.types import (
8
+ MCField,
8
9
  DictInput,
9
10
  MultipleChoice,
10
11
  FloatParam,
11
- InFile,
12
12
  IntParam,
13
13
  MultipleChoiceParam,
14
14
  GroupedMultipleChoiceParam,
@@ -17,6 +17,7 @@ from .sdk.types import (
17
17
  FileInputURL,
18
18
  BinaryParam,
19
19
  Prompt,
20
+ PromptTemplate,
20
21
  )
21
22
 
22
23
  from .sdk.utils.logging import log as logging
@@ -28,6 +29,7 @@ from .sdk.agenta_init import Config, AgentaSingleton, init as _init
28
29
  from .sdk.utils.costs import calculate_token_usage
29
30
  from .sdk.client import Agenta
30
31
  from .sdk.litellm import litellm as callbacks
32
+ from .sdk.managers.vault import VaultManager
31
33
  from .sdk.managers.secrets import SecretsManager
32
34
  from .sdk.managers.config import ConfigManager
33
35
  from .sdk.managers.variant import VariantManager
@@ -99,13 +99,17 @@ class AgentaApi:
99
99
  self._client_wrapper = SyncClientWrapper(
100
100
  base_url=base_url,
101
101
  api_key=api_key,
102
- httpx_client=httpx_client
103
- if httpx_client is not None
104
- else httpx.Client(
105
- timeout=_defaulted_timeout, follow_redirects=follow_redirects
106
- )
107
- if follow_redirects is not None
108
- else httpx.Client(timeout=_defaulted_timeout),
102
+ httpx_client=(
103
+ httpx_client
104
+ if httpx_client is not None
105
+ else (
106
+ httpx.Client(
107
+ timeout=_defaulted_timeout, follow_redirects=follow_redirects
108
+ )
109
+ if follow_redirects is not None
110
+ else httpx.Client(timeout=_defaulted_timeout)
111
+ )
112
+ ),
109
113
  timeout=_defaulted_timeout,
110
114
  )
111
115
  self.observability = ObservabilityClient(client_wrapper=self._client_wrapper)
@@ -1635,13 +1639,17 @@ class AsyncAgentaApi:
1635
1639
  self._client_wrapper = AsyncClientWrapper(
1636
1640
  base_url=base_url,
1637
1641
  api_key=api_key,
1638
- httpx_client=httpx_client
1639
- if httpx_client is not None
1640
- else httpx.AsyncClient(
1641
- timeout=_defaulted_timeout, follow_redirects=follow_redirects
1642
- )
1643
- if follow_redirects is not None
1644
- else httpx.AsyncClient(timeout=_defaulted_timeout),
1642
+ httpx_client=(
1643
+ httpx_client
1644
+ if httpx_client is not None
1645
+ else (
1646
+ httpx.AsyncClient(
1647
+ timeout=_defaulted_timeout, follow_redirects=follow_redirects
1648
+ )
1649
+ if follow_redirects is not None
1650
+ else httpx.AsyncClient(timeout=_defaulted_timeout)
1651
+ )
1652
+ ),
1645
1653
  timeout=_defaulted_timeout,
1646
1654
  )
1647
1655
  self.observability = AsyncObservabilityClient(
@@ -148,9 +148,9 @@ def get_request_body(
148
148
  json_body = maybe_filter_request_body(json, request_options, omit)
149
149
 
150
150
  # If you have an empty JSON body, you should just send None
151
- return (
152
- json_body if json_body != {} else None
153
- ), data_body if data_body != {} else None
151
+ return (json_body if json_body != {} else None), (
152
+ data_body if data_body != {} else None
153
+ )
154
154
 
155
155
 
156
156
  class HttpClient:
agenta/sdk/__init__.py CHANGED
@@ -8,7 +8,6 @@ from .types import (
8
8
  DictInput,
9
9
  MultipleChoice,
10
10
  FloatParam,
11
- InFile,
12
11
  IntParam,
13
12
  MultipleChoiceParam,
14
13
  GroupedMultipleChoiceParam,
@@ -27,6 +26,7 @@ from .tracing.conventions import Reference
27
26
  from .decorators.routing import entrypoint, app, route
28
27
  from .agenta_init import Config, AgentaSingleton, init as _init
29
28
  from .utils.costs import calculate_token_usage
29
+ from .managers.vault import VaultManager
30
30
  from .managers.secrets import SecretsManager
31
31
  from .managers.config import ConfigManager
32
32
  from .managers.variant import VariantManager
@@ -9,6 +9,7 @@ from pydantic import BaseModel
9
9
  class RoutingContext(BaseModel):
10
10
  parameters: Optional[Dict[str, Any]] = None
11
11
  secrets: Optional[List[Any]] = None
12
+ mock: Optional[str] = None
12
13
 
13
14
 
14
15
  routing_context = ContextVar("routing_context", default=RoutingContext())