amigo_sdk 0.58.0__py3-none-any.whl → 0.67.0__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.
amigo_sdk/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.58.0"
1
+ __version__ = "0.67.0"
2
2
  from .sdk_client import AmigoClient, AsyncAmigoClient
3
3
 
4
4
  __all__ = ["__version__", "AmigoClient", "AsyncAmigoClient"]
amigo_sdk/_retry_utils.py CHANGED
@@ -1,12 +1,11 @@
1
1
  import datetime as dt
2
2
  import random
3
3
  from email.utils import parsedate_to_datetime
4
- from typing import Optional
5
4
 
6
5
  DEFAULT_RETRYABLE_STATUS: set[int] = {429, 500, 502, 503, 504}
7
6
 
8
7
 
9
- def parse_retry_after_seconds(retry_after: Optional[str]) -> float | None:
8
+ def parse_retry_after_seconds(retry_after: str | None) -> float | None:
10
9
  """Parse Retry-After header into seconds.
11
10
 
12
11
  Supports both numeric seconds and HTTP-date formats. Returns None when
@@ -55,7 +54,7 @@ def compute_retry_delay_seconds(
55
54
  attempt: int,
56
55
  backoff_base: float,
57
56
  max_delay_seconds: float,
58
- retry_after_header: Optional[str],
57
+ retry_after_header: str | None,
59
58
  ) -> float:
60
59
  """Compute delay for a given retry attempt.
61
60
 
amigo_sdk/errors.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Any, Optional
1
+ from typing import Any
2
2
 
3
3
 
4
4
  class AmigoError(Exception):
@@ -10,9 +10,9 @@ class AmigoError(Exception):
10
10
  self,
11
11
  message: str,
12
12
  *,
13
- status_code: Optional[int] = None,
14
- error_code: Optional[str] = None,
15
- response_body: Optional[Any] = None,
13
+ status_code: int | None = None,
14
+ error_code: str | None = None,
15
+ response_body: Any | None = None,
16
16
  ) -> None:
17
17
  super().__init__(message)
18
18
  self.status_code = status_code
@@ -55,7 +55,7 @@ class RateLimitError(AmigoError): # 429
55
55
 
56
56
  # ---- Validation / semantic errors ------------------------------------------
57
57
  class ValidationError(BadRequestError): # 422 or 400 with `errors` list
58
- def __init__(self, *args, field_errors: Optional[dict[str, str]] = None, **kwargs):
58
+ def __init__(self, *args, field_errors: dict[str, str] | None = None, **kwargs):
59
59
  super().__init__(*args, **kwargs)
60
60
  self.field_errors = field_errors or {}
61
61
 
@@ -1,14 +1,22 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: <stdin>
3
- # timestamp: 2025-11-12T01:18:51+00:00
3
+ # timestamp: 2025-12-02T08:21:19+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
7
7
  from datetime import timedelta
8
- from enum import Enum
8
+ from enum import Enum, IntEnum
9
9
  from typing import Any, Dict, List, Literal, Optional, Union
10
10
 
11
- from pydantic import AnyUrl, AwareDatetime, BaseModel, EmailStr, Field, RootModel
11
+ from pydantic import (
12
+ AnyUrl,
13
+ AwareDatetime,
14
+ BaseModel,
15
+ ConfigDict,
16
+ EmailStr,
17
+ Field,
18
+ RootModel,
19
+ )
12
20
 
13
21
 
14
22
  class ActionTooLongEvent(BaseModel):
@@ -499,20 +507,7 @@ class JumpbackStateTransitionLog(BaseModel):
499
507
  )
500
508
 
501
509
 
502
- class LLMLoadBalancingSetType(Enum):
503
- o4_mini_2025_04_16 = 'o4-mini-2025-04-16'
504
- gpt_5_2025_08_07 = 'gpt-5-2025-08-07'
505
- gpt_5_mini_2025_08_07 = 'gpt-5-mini-2025-08-07'
506
- gpt_5_nano_2025_08_07 = 'gpt-5-nano-2025-08-07'
507
- claude_sonnet_4_5_20250929 = 'claude-sonnet-4-5-20250929'
508
-
509
-
510
510
  class LLMType(Enum):
511
- openai_o4_mini_2025_04_16 = 'openai_o4-mini-2025-04-16'
512
- openai_gpt_5_2025_08_07 = 'openai_gpt-5-2025-08-07'
513
- openai_gpt_5_mini_2025_08_07 = 'openai_gpt-5-mini-2025-08-07'
514
- openai_gpt_5_nano_2025_08_07 = 'openai_gpt-5-nano-2025-08-07'
515
- azure_o4_mini_2025_04_16 = 'azure_o4-mini-2025-04-16'
516
511
  azure_gpt_4_1_2025_04_14 = 'azure_gpt-4.1-2025-04-14'
517
512
  azure_gpt_4_1_mini_2025_04_14 = 'azure_gpt-4.1-mini-2025-04-14'
518
513
  azure_gpt_5_2025_08_07 = 'azure_gpt-5-2025-08-07'
@@ -520,7 +515,6 @@ class LLMType(Enum):
520
515
  azure_gpt_5_nano_2025_08_07 = 'azure_gpt-5-nano-2025-08-07'
521
516
  google_claude_sonnet_4_5_20250929 = 'google_claude-sonnet-4-5@20250929'
522
517
  aws_claude_sonnet_4_5_20250929 = 'aws_claude-sonnet-4-5-20250929'
523
- anthropic_claude_sonnet_4_5_20250929 = 'anthropic_claude-sonnet-4-5-20250929'
524
518
  google_gemini_2_5_pro = 'google_gemini-2.5-pro'
525
519
  google_gemini_2_5_flash = 'google_gemini-2.5-flash'
526
520
 
@@ -566,6 +560,14 @@ class MetricValueType(Enum):
566
560
  categorical = 'categorical'
567
561
 
568
562
 
563
+ class Model(BaseModel):
564
+ model_config = ConfigDict(
565
+ extra='allow',
566
+ )
567
+ name: str = Field(..., title='Name')
568
+ params_model_schema: Dict[str, Any] = Field(..., title='Params Model Schema')
569
+
570
+
569
571
  class NavigateStateMachineActionStateActionSelectedEvent(BaseModel):
570
572
  type: Literal['navigate-state-machine-action-state-action-selected'] = Field(
571
573
  'navigate-state-machine-action-state-action-selected', title='Type'
@@ -785,32 +787,20 @@ class NumericalMetricValue(BaseModel):
785
787
  upper_bound: float = Field(..., title='Upper Bound')
786
788
 
787
789
 
788
- class PCMUserMessageAudioConfigSampleWidth(Enum):
790
+ class PCMUserMessageAudioConfigSampleWidth(IntEnum):
789
791
  integer_2 = 2
790
792
  integer_4 = 4
791
793
 
792
794
 
793
795
  class PCMUserMessageAudioConfig(BaseModel):
794
796
  type: Literal['pcm'] = Field('pcm', title='Type')
795
- frame_rate: int = Field(..., title='Frame Rate')
797
+ frame_rate: int = Field(..., ge=4000, le=44100, title='Frame Rate')
796
798
  n_channels: Literal[1] = Field(..., title='N Channels')
797
799
  sample_width: PCMUserMessageAudioConfigSampleWidth = Field(
798
800
  ..., title='Sample Width'
799
801
  )
800
802
 
801
803
 
802
- class PerLLMConfig(BaseModel):
803
- top_p: float = Field(..., description='The preferred `top_p` value.', title='Top P')
804
- temperature: float = Field(
805
- ..., description='The preferred temperature value.', title='Temperature'
806
- )
807
- top_k: int = Field(
808
- ...,
809
- description='The preferred `top_k` value. Note that not all LLMs support this.',
810
- title='Top K',
811
- )
812
-
813
-
814
804
  class PostAnalysisType(Enum):
815
805
  generate_user_models = 'generate-user-models'
816
806
  extract_memories = 'extract-memories'
@@ -917,6 +907,12 @@ class ReflectionStateOutputNextState(AnnotationStateOutputNextState):
917
907
  pass
918
908
 
919
909
 
910
+ class ResultPersistence(Enum):
911
+ ephemeral = 'ephemeral'
912
+ persisted_preferred = 'persisted-preferred'
913
+ persisted = 'persisted'
914
+
915
+
920
916
  class SelectDynamicBehaviorCompletedEventSelectedDynamicBehaviorSetVersionInfo(
921
917
  RootModel[List]
922
918
  ):
@@ -1153,7 +1149,11 @@ class ToolCallLog(BaseModel):
1153
1149
  input: Dict[str, Any] = Field(
1154
1150
  ..., description='The input to the tool call.', title='Input'
1155
1151
  )
1156
- output: str = Field(..., description='The output of the tool call.', title='Output')
1152
+ output: Optional[str] = Field(
1153
+ ...,
1154
+ description="The output of the tool call. If `None`, the tool call's output is ephemeral and not stored.",
1155
+ title='Output',
1156
+ )
1157
1157
  duration: float = Field(
1158
1158
  ..., description='The duration of the tool call in seconds.', title='Duration'
1159
1159
  )
@@ -1181,6 +1181,10 @@ class ToolCallSpecOutput(BaseModel):
1181
1181
  description='The number of seconds to wait before playing an audio filler.',
1182
1182
  title='Audio Filler Triggered After',
1183
1183
  )
1184
+ result_persistence: ResultPersistence = Field(
1185
+ ...,
1186
+ description="The type of result persistence for this tool call.\n\n- If `ephemeral`, the result of the tool call is only provided to the current LLM interaction. Any future LLM interactions will not see this tool result.\n- If `persisted-preferred`, the result of the tool call is reflected in all future LLM interactions if it's less than 5000 characters long. Otherwise, it's only visible in the current LLM interaction.\n- If `persisted`, the result of the tool call is reflected in all future LLM interactions, unless it's more than 5000 characters long, in which case an error is thrown.",
1187
+ )
1184
1188
 
1185
1189
 
1186
1190
  class ToolCallStartedEvent(BaseModel):
@@ -1451,6 +1455,35 @@ class VersionComponent(RootModel[Union[int, str]]):
1451
1455
  root: Union[int, str]
1452
1456
 
1453
1457
 
1458
+ class VoiceResponseMP3AudioFormatSampleRate(IntEnum):
1459
+ integer_22050 = 22050
1460
+ integer_44100 = 44100
1461
+
1462
+
1463
+ class VoiceResponseMP3AudioFormatSampleWidth(IntEnum):
1464
+ integer_4 = 4
1465
+ integer_8 = 8
1466
+
1467
+
1468
+ class VoiceResponseMP3AudioFormat(BaseModel):
1469
+ type: Literal['mp3'] = Field('mp3', title='Type')
1470
+ sample_rate: VoiceResponseMP3AudioFormatSampleRate = Field(..., title='Sample Rate')
1471
+ sample_width: VoiceResponseMP3AudioFormatSampleWidth = Field(
1472
+ ..., title='Sample Width'
1473
+ )
1474
+
1475
+
1476
+ class VoiceResponsePCMAudioFormatSampleRate(IntEnum):
1477
+ integer_8000 = 8000
1478
+ integer_16000 = 16000
1479
+ integer_44100 = 44100
1480
+
1481
+
1482
+ class VoiceResponsePCMAudioFormat(BaseModel):
1483
+ type: Literal['pcm'] = Field('pcm', title='Type')
1484
+ sample_rate: VoiceResponsePCMAudioFormatSampleRate = Field(..., title='Sample Rate')
1485
+
1486
+
1454
1487
  class WebhookDeliveryStatus(Enum):
1455
1488
  success = 'success'
1456
1489
  failed = 'failed'
@@ -1509,27 +1542,8 @@ class AmigoLibLlmLlmBaseLLMConfig(BaseModel):
1509
1542
  llm_name: str = Field(
1510
1543
  ..., description='The name of the LLM to use.', title='Llm Name'
1511
1544
  )
1512
- top_p: float = Field(..., description='The preferred `top_p` value.', title='Top P')
1513
- temperature: float = Field(
1514
- ..., description='The preferred temperature value.', title='Temperature'
1515
- )
1516
- top_k: int = Field(
1517
- ...,
1518
- description='The preferred `top_k` value. Note that not all LLMs support this.',
1519
- title='Top K',
1520
- )
1521
-
1522
-
1523
- class AmigoLibLlmLlmBaseLLMLoadBalancingSetConfig(BaseModel):
1524
- llm_load_balancing_set_name: str = Field(
1525
- ...,
1526
- description='The name of the LLM load balancing set.',
1527
- title='Llm Load Balancing Set Name',
1528
- )
1529
- configs: Dict[str, PerLLMConfig] = Field(
1530
- ...,
1531
- description='A map of canonical names of LLMs in this load balancing set to the LLM config to use. If an LLM in the load balancing set\ndoes not have a config, its default config would be used.',
1532
- title='Configs',
1545
+ params: Optional[Dict[str, Any]] = Field(
1546
+ {}, description='LLM-specific parameters to use.', title='Params'
1533
1547
  )
1534
1548
 
1535
1549
 
@@ -1627,10 +1641,7 @@ class AmigoLibMongoCollectionsServiceServiceVersionSet(BaseModel):
1627
1641
  description='The version number of the state machine to be used. If None, the latest state machine version will be used.',
1628
1642
  title='Service Hierarchical State Machine Version Number',
1629
1643
  )
1630
- llm_model_preferences: Dict[
1631
- str,
1632
- Union[AmigoLibLlmLlmBaseLLMConfig, AmigoLibLlmLlmBaseLLMLoadBalancingSetConfig],
1633
- ] = Field(
1644
+ llm_model_preferences: Dict[str, AmigoLibLlmLlmBaseLLMConfig] = Field(
1634
1645
  ...,
1635
1646
  description='A map of `LLMInteraction` name to the preferred LLM config that can be used for that interaction.\nIf an `LLMInteraction` is not in this map, the default model config will be used (defined in each `LLMInteraction` instance).',
1636
1647
  title='Llm Model Preferences',
@@ -1693,12 +1704,6 @@ AmigoLibMongoCollectionsSimulationUnitTestSetRunSimulationUnitTestSetRunUserInfo
1693
1704
  )
1694
1705
 
1695
1706
 
1696
- class AmigoLibMongoCollectionsToolInvocationToolInvocationVersion(BaseModel):
1697
- major: int = Field(..., title='Major')
1698
- minor: int = Field(..., title='Minor')
1699
- patch: int = Field(..., title='Patch')
1700
-
1701
-
1702
1707
  class AmigoLibMongoCollectionsToolVersionToolVersionUserInfo(BaseModel):
1703
1708
  user_id: str = Field(..., description='The ID of the user.', title='User Id')
1704
1709
  user_org_id: str = Field(
@@ -1706,6 +1711,12 @@ class AmigoLibMongoCollectionsToolVersionToolVersionUserInfo(BaseModel):
1706
1711
  )
1707
1712
 
1708
1713
 
1714
+ class AmigoLibMongoCollectionsToolVersionToolVersionVersion(BaseModel):
1715
+ major: int = Field(..., title='Major')
1716
+ minor: int = Field(..., title='Minor')
1717
+ patch: int = Field(..., title='Patch')
1718
+
1719
+
1709
1720
  class AmigoLibMongoCollectionsUserUserPreferences(BaseModel):
1710
1721
  enable_response_recommendation: Optional[bool] = Field(
1711
1722
  False,
@@ -1747,6 +1758,13 @@ class AmigoLibPydanticBaseModelStrippedNonemptyString3(RootModel[str]):
1747
1758
  root: str = Field(..., max_length=3, min_length=1)
1748
1759
 
1749
1760
 
1761
+ class AdminGetModelsResponse(BaseModel):
1762
+ model_config = ConfigDict(
1763
+ extra='allow',
1764
+ )
1765
+ models: List[Model] = Field(..., title='Models')
1766
+
1767
+
1750
1768
  class AdminSubmitSqlQueryRequest(BaseModel):
1751
1769
  sql_query: str = Field(..., description='The SQL query to execute.', min_length=1)
1752
1770
  async_query: Literal[False] = Field(
@@ -1937,20 +1955,6 @@ class DynamicBehaviorSetGetDynamicBehaviorInvocationsResponse(BaseModel):
1937
1955
  )
1938
1956
 
1939
1957
 
1940
- class DynamicBehaviorSetGetDynamicBehaviorSetsResponseDynamicBehaviorSetInstance(
1941
- BaseModel
1942
- ):
1943
- id: str = Field(..., title='Id')
1944
- name: str = Field(..., title='Name')
1945
- is_active: bool = Field(..., title='Is Active')
1946
- applied_to_services: List[str] = Field(..., title='Applied To Services')
1947
- tags: Dict[str, Optional[str]] = Field(..., title='Tags')
1948
- created_at: AwareDatetime = Field(..., title='Created At')
1949
- creator: AmigoLibMongoCollectionsDynamicBehaviorSetDynamicBehaviorSetUserInfo
1950
- updated_at: AwareDatetime = Field(..., title='Updated At')
1951
- updated_by: AmigoLibMongoCollectionsDynamicBehaviorSetDynamicBehaviorSetUserInfo
1952
-
1953
-
1954
1958
  class DynamicBehaviorSetGetDynamicBehaviorSetsResponseFilterValues(BaseModel):
1955
1959
  applied_to_services_ids: List[str] = Field(
1956
1960
  ...,
@@ -1971,14 +1975,18 @@ class DynamicBehaviorSetGetDynamicBehaviorSetsResponseFilterValues(BaseModel):
1971
1975
  )
1972
1976
 
1973
1977
 
1974
- class DynamicBehaviorSetSearchDynamicBehaviorSetsResponse(BaseModel):
1975
- dynamic_behavior_sets: List[
1976
- DynamicBehaviorSetGetDynamicBehaviorSetsResponseDynamicBehaviorSetInstance
1977
- ] = Field(
1978
- ...,
1979
- description='The retrieved dynamic behavior sets.',
1980
- title='Dynamic Behavior Sets',
1981
- )
1978
+ class DynamicBehaviorSetSearchDynamicBehaviorSetsResponseDynamicBehaviorSetInstance(
1979
+ BaseModel
1980
+ ):
1981
+ id: str = Field(..., title='Id')
1982
+ name: str = Field(..., title='Name')
1983
+ is_active: bool = Field(..., title='Is Active')
1984
+ applied_to_services: List[str] = Field(..., title='Applied To Services')
1985
+ tags: Dict[str, Optional[str]] = Field(..., title='Tags')
1986
+ created_at: AwareDatetime = Field(..., title='Created At')
1987
+ creator: AmigoLibMongoCollectionsDynamicBehaviorSetDynamicBehaviorSetUserInfo
1988
+ updated_at: AwareDatetime = Field(..., title='Updated At')
1989
+ updated_by: AmigoLibMongoCollectionsDynamicBehaviorSetDynamicBehaviorSetUserInfo
1982
1990
 
1983
1991
 
1984
1992
  class DynamicBehaviorSetUpdateDynamicBehaviorSetRequestAppliedToService(
@@ -10734,6 +10742,13 @@ class OrganizationCreateOrganizationRequestPreferences(BaseModel):
10734
10742
  )
10735
10743
 
10736
10744
 
10745
+ class OrganizationCreateOrganizationRequestUserDimension(BaseModel):
10746
+ description: str = Field(..., min_length=1)
10747
+ tags: List[AmigoLibPydanticBaseModelStrippedNonemptyString1] = Field(
10748
+ ..., title='Tags'
10749
+ )
10750
+
10751
+
10737
10752
  class OrganizationCreateOrganizationResponse(BaseModel):
10738
10753
  org_id: str = Field(
10739
10754
  ...,
@@ -10875,18 +10890,22 @@ class OrganizationGetUserDimensionsResponse(BaseModel):
10875
10890
  )
10876
10891
 
10877
10892
 
10893
+ class OrganizationModifyOrganizationRequestUserDimensions(
10894
+ RootModel[List[OrganizationCreateOrganizationRequestUserDimension]]
10895
+ ):
10896
+ root: List[OrganizationCreateOrganizationRequestUserDimension] = Field(
10897
+ ...,
10898
+ description='User dimensions for the organization. If not set or `null`, this field is not updated.',
10899
+ min_length=1,
10900
+ title='User Dimensions',
10901
+ )
10902
+
10903
+
10878
10904
  OrganizationModifyOrganizationRequestPreferences = (
10879
10905
  OrganizationCreateOrganizationRequestPreferences
10880
10906
  )
10881
10907
 
10882
10908
 
10883
- class OrganizationModifyOrganizationRequestUserDimension(BaseModel):
10884
- description: str = Field(..., min_length=1)
10885
- tags: List[AmigoLibPydanticBaseModelStrippedNonemptyString1] = Field(
10886
- ..., title='Tags'
10887
- )
10888
-
10889
-
10890
10909
  class RoleAssignRoleRequest(BaseModel):
10891
10910
  user_id: str = Field(
10892
10911
  ...,
@@ -10933,11 +10952,6 @@ class RoleModifyRoleResponse(BaseModel):
10933
10952
  )
10934
10953
 
10935
10954
 
10936
- class ServiceCreateServiceRequestVersionSetLLMLoadBalancingSetConfig(BaseModel):
10937
- llm_load_balancing_set_name: LLMLoadBalancingSetType
10938
- configs: Dict[str, PerLLMConfig] = Field(..., title='Configs')
10939
-
10940
-
10941
10955
  class ServiceCreateServiceResponse(BaseModel):
10942
10956
  id: str = Field(..., description='The ID of the newly created service.', title='Id')
10943
10957
 
@@ -10999,14 +11013,8 @@ class ServiceUpdateServiceRequest(BaseModel):
10999
11013
 
11000
11014
  class ServiceUpsertServiceVersionSetRequestVersionSetLLMConfig(BaseModel):
11001
11015
  llm_name: LLMType
11002
- top_p: float = Field(..., description='The preferred `top_p` value.', title='Top P')
11003
- temperature: float = Field(
11004
- ..., description='The preferred temperature value.', title='Temperature'
11005
- )
11006
- top_k: int = Field(
11007
- ...,
11008
- description='The preferred `top_k` value. Note that not all LLMs support this.',
11009
- title='Top K',
11016
+ params: Optional[Dict[str, Any]] = Field(
11017
+ {}, description='LLM-specific parameters to use.', title='Params'
11010
11018
  )
11011
11019
 
11012
11020
 
@@ -11664,7 +11672,7 @@ class UserGetMemoriesResponse(BaseModel):
11664
11672
  )
11665
11673
 
11666
11674
 
11667
- class UserSearchUsersResponseUserInstanceUserStats(BaseModel):
11675
+ class UserGetUsersResponseUserInstanceUserStats(BaseModel):
11668
11676
  num_conversations: int = Field(
11669
11677
  ...,
11670
11678
  description='The number of conversations the user has created.',
@@ -11706,14 +11714,6 @@ class UserSignInWithEmailRequest(BaseModel):
11706
11714
  )
11707
11715
 
11708
11716
 
11709
- class UserSignInWithEmailResponse(BaseModel):
11710
- user_id: str = Field(
11711
- ...,
11712
- description='The identifier of the user corresponding to the email.',
11713
- title='User Id',
11714
- )
11715
-
11716
-
11717
11717
  class UserUpdateUserInfoRequest(BaseModel):
11718
11718
  first_name: Optional[AmigoLibPydanticBaseModelStrippedNonemptyString1] = Field(
11719
11719
  None,
@@ -12046,24 +12046,6 @@ class CreateConversationParametersQueryAudioFormat(Enum):
12046
12046
  pcm = 'pcm'
12047
12047
 
12048
12048
 
12049
- class CreateConversationParametersQuery(BaseModel):
12050
- response_format: Format = Field(
12051
- ...,
12052
- description='The format of the response that will be sent to the user.',
12053
- title='Response Format',
12054
- )
12055
- current_agent_action_type: Optional[str] = Field(
12056
- '^.*$',
12057
- description="A regex for filtering the type of the current agent action to return. By default, all are returned. If you don't want to receive any events, set this to a regex that matches nothing, for instance `^$`.",
12058
- title='Current Agent Action Type',
12059
- )
12060
- audio_format: Optional[CreateConversationParametersQueryAudioFormat] = Field(
12061
- None,
12062
- description='The format of the audio response, if `response_format` is set to `voice`.',
12063
- title='Audio Format',
12064
- )
12065
-
12066
-
12067
12049
  class GetConversationsParametersQueryServiceIdItem(
12068
12050
  DynamicBehaviorSetCreateDynamicBehaviorSetRequestAppliedToService
12069
12051
  ):
@@ -12129,7 +12111,7 @@ class GetConversationMessagesParametersQuery(BaseModel):
12129
12111
  [], description='The IDs of the messages to retrieve.', title='Id'
12130
12112
  )
12131
12113
  message_type: Optional[List[MessageType]] = Field(
12132
- ['agent-message', 'user-message', 'external-event'],
12114
+ ['user-message', 'agent-message', 'external-event'],
12133
12115
  description='The type of messages to retrieve.',
12134
12116
  title='Message Type',
12135
12117
  )
@@ -12159,36 +12141,108 @@ class GetConversationMessagesParametersQuery(BaseModel):
12159
12141
  )
12160
12142
 
12161
12143
 
12162
- class InteractWithConversationParametersQuery(BaseModel):
12163
- request_format: Format = Field(
12164
- ...,
12165
- description='The format in which the user message is delivered to the server.',
12166
- title='Request Format',
12144
+ class InteractWithConversationRequestInteractWithConversationRequestExternalEventMessageContent(
12145
+ AmigoLibPydanticBaseModelStrippedNonemptyString1
12146
+ ):
12147
+ pass
12148
+
12149
+
12150
+ class InteractWithConversationRequestInteractWithConversationRequest(BaseModel):
12151
+ initial_message_type: Literal['external-event'] = Field(
12152
+ ..., title='Initial Message Type'
12167
12153
  )
12168
- response_format: Format = Field(
12169
- ...,
12170
- description='The format of the response that will be sent to the user.',
12171
- title='Response Format',
12154
+ recorded_message: str = Field(..., min_length=1)
12155
+ external_event_message_contents: Optional[
12156
+ List[
12157
+ InteractWithConversationRequestInteractWithConversationRequestExternalEventMessageContent
12158
+ ]
12159
+ ] = Field(
12160
+ [],
12161
+ description='The contents of external event messages to be inserted before the initial message, in chronological order.',
12162
+ title='External Event Message Contents',
12172
12163
  )
12173
- current_agent_action_type: Optional[str] = Field(
12174
- '^.*$',
12175
- description="A regex for filtering the type of the current agent action to return. By default, all are returned. If you don't want to receive any events, set this to a regex that matches nothing, for instance `^$`.",
12176
- title='Current Agent Action Type',
12164
+ external_event_message_timestamps: Optional[List[AwareDatetime]] = Field(
12165
+ [],
12166
+ description='The timestamps of external event messages to be inserted before the initial message, in chronological order.',
12167
+ title='External Event Message Timestamps',
12177
12168
  )
12178
- request_audio_config: Optional[
12179
- Union[MP3UserMessageAudioConfig, PCMUserMessageAudioConfig]
12169
+
12170
+
12171
+ class InteractWithConversationRequestInteractWithConversationRequest1ExternalEventMessageContent(
12172
+ AmigoLibPydanticBaseModelStrippedNonemptyString1
12173
+ ):
12174
+ pass
12175
+
12176
+
12177
+ class InteractWithConversationRequest_InteractWithConversationRequest(BaseModel):
12178
+ initial_message_type: Literal['user-message'] = Field(
12179
+ ..., title='Initial Message Type'
12180
+ )
12181
+ recorded_message: str = Field(..., min_length=1)
12182
+ external_event_message_contents: Optional[
12183
+ List[
12184
+ InteractWithConversationRequestInteractWithConversationRequest1ExternalEventMessageContent
12185
+ ]
12180
12186
  ] = Field(
12181
- None,
12182
- description='Configuration for the user message audio. This is only required if `request_format` is set to `voice`.',
12183
- title='Request Audio Config',
12187
+ [],
12188
+ description='The contents of external event messages to be inserted before the initial message, in chronological order.',
12189
+ title='External Event Message Contents',
12184
12190
  )
12185
- audio_format: Optional[CreateConversationParametersQueryAudioFormat] = Field(
12186
- None,
12187
- description='The format of the audio response, if `response_format` is set to `voice`.',
12188
- title='Audio Format',
12191
+ external_event_message_timestamps: Optional[List[AwareDatetime]] = Field(
12192
+ [],
12193
+ description='The timestamps of external event messages to be inserted before the initial message, in chronological order.',
12194
+ title='External Event Message Timestamps',
12189
12195
  )
12190
12196
 
12191
12197
 
12198
+ class InteractWithConversationRequestInteractWithConversationRequest2ExternalEventMessageContent(
12199
+ AmigoLibPydanticBaseModelStrippedNonemptyString1
12200
+ ):
12201
+ pass
12202
+
12203
+
12204
+ class InteractWithConversationRequestInteractWithConversationRequest2(BaseModel):
12205
+ initial_message_type: Literal['skip'] = Field(..., title='Initial Message Type')
12206
+ recorded_message: str = Field(
12207
+ ...,
12208
+ description='The body of the initial message, which must be empty.',
12209
+ max_length=0,
12210
+ title='Recorded Message',
12211
+ )
12212
+ external_event_message_contents: Optional[
12213
+ List[
12214
+ InteractWithConversationRequestInteractWithConversationRequest2ExternalEventMessageContent
12215
+ ]
12216
+ ] = Field(
12217
+ [],
12218
+ description='Must be empty, as external event messages cannot be sent with skips.',
12219
+ max_length=0,
12220
+ title='External Event Message Contents',
12221
+ )
12222
+ external_event_message_timestamps: Optional[List[AwareDatetime]] = Field(
12223
+ [],
12224
+ description='Must be empty, as external event messages cannot be sent with skips.',
12225
+ max_length=0,
12226
+ title='External Event Message Timestamps',
12227
+ )
12228
+
12229
+
12230
+ class InteractWithConversationRequest(
12231
+ RootModel[
12232
+ Union[
12233
+ InteractWithConversationRequestInteractWithConversationRequest,
12234
+ InteractWithConversationRequest_InteractWithConversationRequest,
12235
+ InteractWithConversationRequestInteractWithConversationRequest2,
12236
+ ]
12237
+ ]
12238
+ ):
12239
+ root: Union[
12240
+ InteractWithConversationRequestInteractWithConversationRequest,
12241
+ InteractWithConversationRequest_InteractWithConversationRequest,
12242
+ InteractWithConversationRequestInteractWithConversationRequest2,
12243
+ ]
12244
+
12245
+
12192
12246
  class RetrieveMessageSourceParametersQuery(BaseModel):
12193
12247
  long_lived: Optional[bool] = Field(
12194
12248
  False,
@@ -12271,6 +12325,9 @@ class SearchUsersParametersQuery(BaseModel):
12271
12325
  description='The search query. Any users whose name or email contains the query are returned.',
12272
12326
  title='Query',
12273
12327
  )
12328
+ user_id: Optional[List[str]] = Field(
12329
+ [], description='The IDs of the users.', title='User Id'
12330
+ )
12274
12331
 
12275
12332
 
12276
12333
  class GetRolesV1OrganizationRoleGetParametersQueryIdItem(
@@ -14011,6 +14068,10 @@ class ToolCallSpecInput(BaseModel):
14011
14068
  le=10.0,
14012
14069
  title='Audio Filler Triggered After',
14013
14070
  )
14071
+ result_persistence: ResultPersistence = Field(
14072
+ ...,
14073
+ description="The type of result persistence for this tool call.\n\n- If `ephemeral`, the result of the tool call is only provided to the current LLM interaction. Any future LLM interactions will not see this tool result.\n- If `persisted-preferred`, the result of the tool call is reflected in all future LLM interactions if it's less than 5000 characters long. Otherwise, it's only visible in the current LLM interaction.\n- If `persisted`, the result of the tool call is reflected in all future LLM interactions, unless it's more than 5000 characters long, in which case an error is thrown.",
14074
+ )
14014
14075
 
14015
14076
 
14016
14077
  class ToolCallStateInput(BaseModel):
@@ -14083,7 +14144,7 @@ class ToolVersionInstance(BaseModel):
14083
14144
  description='The ID of the tool that this version belongs to.',
14084
14145
  title='Tool Id',
14085
14146
  )
14086
- version: AmigoLibMongoCollectionsToolInvocationToolInvocationVersion = Field(
14147
+ version: AmigoLibMongoCollectionsToolVersionToolVersionVersion = Field(
14087
14148
  ..., description='The version of the tool.'
14088
14149
  )
14089
14150
  required_envvars: List[str] = Field(
@@ -14178,10 +14239,7 @@ class VersionSetInfo(BaseModel):
14178
14239
  min_length=2,
14179
14240
  title='Service Hierarchical State Machine Version Info',
14180
14241
  )
14181
- llm_model_preferences: Dict[
14182
- str,
14183
- Union[AmigoLibLlmLlmBaseLLMConfig, AmigoLibLlmLlmBaseLLMLoadBalancingSetConfig],
14184
- ] = Field(
14242
+ llm_model_preferences: Dict[str, AmigoLibLlmLlmBaseLLMConfig] = Field(
14185
14243
  ...,
14186
14244
  description='The LLM model preferences for this version set.',
14187
14245
  title='Llm Model Preferences',
@@ -14402,7 +14460,7 @@ class DynamicBehaviorSetGetDynamicBehaviorSetVersionsResponse(BaseModel):
14402
14460
 
14403
14461
  class DynamicBehaviorSetGetDynamicBehaviorSetsResponse(BaseModel):
14404
14462
  dynamic_behavior_sets: List[
14405
- DynamicBehaviorSetGetDynamicBehaviorSetsResponseDynamicBehaviorSetInstance
14463
+ DynamicBehaviorSetSearchDynamicBehaviorSetsResponseDynamicBehaviorSetInstance
14406
14464
  ] = Field(
14407
14465
  ...,
14408
14466
  description='The retrieved dynamic behavior sets.',
@@ -14426,6 +14484,16 @@ class DynamicBehaviorSetGetDynamicBehaviorSetsResponse(BaseModel):
14426
14484
  )
14427
14485
 
14428
14486
 
14487
+ class DynamicBehaviorSetSearchDynamicBehaviorSetsResponse(BaseModel):
14488
+ dynamic_behavior_sets: List[
14489
+ DynamicBehaviorSetSearchDynamicBehaviorSetsResponseDynamicBehaviorSetInstance
14490
+ ] = Field(
14491
+ ...,
14492
+ description='The retrieved dynamic behavior sets.',
14493
+ title='Dynamic Behavior Sets',
14494
+ )
14495
+
14496
+
14429
14497
  class MetricCreateMetricRequest(BaseModel):
14430
14498
  name: str = Field(
14431
14499
  ...,
@@ -14482,7 +14550,7 @@ class OrganizationCreateOrganizationRequest(BaseModel):
14482
14550
  description='Additional descriptions of the services offered by this organization that is displayed below `main_description` in a smaller font.',
14483
14551
  min_length=1,
14484
14552
  )
14485
- user_dimensions: List[OrganizationModifyOrganizationRequestUserDimension] = Field(
14553
+ user_dimensions: List[OrganizationCreateOrganizationRequestUserDimension] = Field(
14486
14554
  ...,
14487
14555
  description='User dimensions for the organization.',
14488
14556
  title='User Dimensions',
@@ -14626,17 +14694,6 @@ class OrganizationGetOrganizationMetricsResponse(BaseModel):
14626
14694
  )
14627
14695
 
14628
14696
 
14629
- class OrganizationModifyOrganizationRequestUserDimensions(
14630
- RootModel[List[OrganizationModifyOrganizationRequestUserDimension]]
14631
- ):
14632
- root: List[OrganizationModifyOrganizationRequestUserDimension] = Field(
14633
- ...,
14634
- description='User dimensions for the organization. If not set or `null`, this field is not updated.',
14635
- min_length=1,
14636
- title='User Dimensions',
14637
- )
14638
-
14639
-
14640
14697
  class OrganizationModifyOrganizationRequest(BaseModel):
14641
14698
  title: Optional[AmigoLibPydanticBaseModelStrippedNonemptyString1] = Field(
14642
14699
  None,
@@ -14746,11 +14803,7 @@ class ServiceCreateServiceRequestVersionSet(BaseModel):
14746
14803
  title='Service Hierarchical State Machine Version Number',
14747
14804
  )
14748
14805
  llm_model_preferences: Dict[
14749
- str,
14750
- Union[
14751
- ServiceUpsertServiceVersionSetRequestVersionSetLLMConfig,
14752
- ServiceCreateServiceRequestVersionSetLLMLoadBalancingSetConfig,
14753
- ],
14806
+ str, ServiceUpsertServiceVersionSetRequestVersionSetLLMConfig
14754
14807
  ] = Field(..., title='Llm Model Preferences')
14755
14808
 
14756
14809
 
@@ -15048,7 +15101,7 @@ class UserGetUserModelResponse(BaseModel):
15048
15101
  )
15049
15102
 
15050
15103
 
15051
- class UserSearchUsersResponseUserInstance(BaseModel):
15104
+ class UserGetUsersResponseUserInstance(BaseModel):
15052
15105
  org_id: str = Field(
15053
15106
  ...,
15054
15107
  description='The ID of the organization that this user belongs to.',
@@ -15064,7 +15117,7 @@ class UserSearchUsersResponseUserInstance(BaseModel):
15064
15117
  ..., description='The last name of the user.', title='Last Name'
15065
15118
  )
15066
15119
  email: str = Field(..., description='Email of the user.', title='Email')
15067
- user_stats: UserSearchUsersResponseUserInstanceUserStats = Field(
15120
+ user_stats: UserGetUsersResponseUserInstanceUserStats = Field(
15068
15121
  ..., description="Statistics about the user's usage of the Amigo platform."
15069
15122
  )
15070
15123
  role: str = Field(..., description='The ID of the role of the user.', title='Role')
@@ -15073,6 +15126,12 @@ class UserSearchUsersResponseUserInstance(BaseModel):
15073
15126
  )
15074
15127
 
15075
15128
 
15129
+ class UserSearchUsersResponse(BaseModel):
15130
+ users: List[UserGetUsersResponseUserInstance] = Field(
15131
+ ..., description='Users in this organization.', title='Users'
15132
+ )
15133
+
15134
+
15076
15135
  class WebhookDestinationGetWebhookDeliveriesResponse(BaseModel):
15077
15136
  webhook_deliveries: List[WebhookDeliveryInstance] = Field(
15078
15137
  ..., description='The retrieved webhook deliveries.', title='Webhook Deliveries'
@@ -15089,6 +15148,68 @@ class WebhookDestinationGetWebhookDeliveriesResponse(BaseModel):
15089
15148
  )
15090
15149
 
15091
15150
 
15151
+ class CreateConversationParametersQuery(BaseModel):
15152
+ response_format: Format = Field(
15153
+ ...,
15154
+ description='The format of the response that will be sent to the user.',
15155
+ title='Response Format',
15156
+ )
15157
+ current_agent_action_type: Optional[str] = Field(
15158
+ '^.*$',
15159
+ description="A regex for filtering the type of the current agent action to return. By default, all are returned. If you don't want to receive any events, set this to a regex that matches nothing, for instance `^$`.",
15160
+ title='Current Agent Action Type',
15161
+ )
15162
+ audio_format: Optional[CreateConversationParametersQueryAudioFormat] = Field(
15163
+ None,
15164
+ description='The format of the audio response, if `response_format` is set to `voice`.',
15165
+ title='Audio Format',
15166
+ )
15167
+ response_audio_format: Optional[
15168
+ Union[VoiceResponsePCMAudioFormat, VoiceResponseMP3AudioFormat]
15169
+ ] = Field(
15170
+ None,
15171
+ description='The format of the audio response, if `response_format` is set to `voice`.',
15172
+ title='Response Audio Format',
15173
+ )
15174
+
15175
+
15176
+ class InteractWithConversationParametersQuery(BaseModel):
15177
+ request_format: Format = Field(
15178
+ ...,
15179
+ description='The format in which the user message is delivered to the server.',
15180
+ title='Request Format',
15181
+ )
15182
+ response_format: Format = Field(
15183
+ ...,
15184
+ description='The format of the response that will be sent to the user.',
15185
+ title='Response Format',
15186
+ )
15187
+ current_agent_action_type: Optional[str] = Field(
15188
+ '^.*$',
15189
+ description="A regex for filtering the type of the current agent action to return. By default, all are returned. If you don't want to receive any events, set this to a regex that matches nothing, for instance `^$`.",
15190
+ title='Current Agent Action Type',
15191
+ )
15192
+ request_audio_config: Optional[
15193
+ Union[MP3UserMessageAudioConfig, PCMUserMessageAudioConfig]
15194
+ ] = Field(
15195
+ None,
15196
+ description='Configuration for the user message audio. This is only required if `request_format` is set to `voice`.',
15197
+ title='Request Audio Config',
15198
+ )
15199
+ audio_format: Optional[CreateConversationParametersQueryAudioFormat] = Field(
15200
+ None,
15201
+ description='The format of the audio response, if `response_format` is set to `voice`.',
15202
+ title='Audio Format',
15203
+ )
15204
+ response_audio_format: Optional[
15205
+ Union[VoiceResponsePCMAudioFormat, VoiceResponseMP3AudioFormat]
15206
+ ] = Field(
15207
+ None,
15208
+ description='The format of the audio response, if `response_format` is set to `voice`.',
15209
+ title='Response Audio Format',
15210
+ )
15211
+
15212
+
15092
15213
  class ActionStateInput(BaseModel):
15093
15214
  type: Literal['action'] = Field(..., title='Type')
15094
15215
  name: str = Field(..., pattern='^[A-Za-z0-9_]+$')
@@ -15611,10 +15732,7 @@ class UnitTestRunSpec(BaseModel):
15611
15732
  description='The version of the persona that the unit test runs on. This field is only populated if the authenticated user has the `Simulation:GetSimulationUnitTest` permission.',
15612
15733
  title='Persona Version Info',
15613
15734
  )
15614
- llm_model_preferences: Dict[
15615
- str,
15616
- Union[AmigoLibLlmLlmBaseLLMConfig, AmigoLibLlmLlmBaseLLMLoadBalancingSetConfig],
15617
- ] = Field(
15735
+ llm_model_preferences: Dict[str, AmigoLibLlmLlmBaseLLMConfig] = Field(
15618
15736
  ...,
15619
15737
  description='The LLM model preferences for the unit test run.',
15620
15738
  title='Llm Model Preferences',
@@ -16066,7 +16184,7 @@ class SimulationUpdateSimulationUnitTestRequest(BaseModel):
16066
16184
  )
16067
16185
 
16068
16186
 
16069
- class ToolSearchToolInvocationsResponseToolInvocationInstance(BaseModel):
16187
+ class ToolGetToolInvocationsResponseToolInvocationInstance(BaseModel):
16070
16188
  id: str = Field(..., description='The ID of the tool invocation.', title='Id')
16071
16189
  org_id: str = Field(..., description='The ID of the organization.', title='Org Id')
16072
16190
  created_at: Optional[AwareDatetime] = Field(None, title='Created At')
@@ -16088,13 +16206,21 @@ class ToolSearchToolInvocationsResponseToolInvocationInstance(BaseModel):
16088
16206
  tool_id: str = Field(
16089
16207
  ..., description='The ID of the tool that was invoked.', title='Tool Id'
16090
16208
  )
16091
- tool_version: AmigoLibMongoCollectionsToolInvocationToolInvocationVersion = Field(
16209
+ tool_version: AmigoLibMongoCollectionsToolVersionToolVersionVersion = Field(
16092
16210
  ..., description='The version of the tool that was invoked.'
16093
16211
  )
16094
16212
 
16095
16213
 
16214
+ class ToolSearchToolInvocationsResponse(BaseModel):
16215
+ tool_invocations: List[ToolGetToolInvocationsResponseToolInvocationInstance] = (
16216
+ Field(
16217
+ ..., description='The list of tool invocations.', title='Tool Invocations'
16218
+ )
16219
+ )
16220
+
16221
+
16096
16222
  class UserGetUsersResponse(BaseModel):
16097
- users: List[UserSearchUsersResponseUserInstance] = Field(
16223
+ users: List[UserGetUsersResponseUserInstance] = Field(
16098
16224
  ..., description='Users in this organization.', title='Users'
16099
16225
  )
16100
16226
  has_more: bool = Field(
@@ -16107,12 +16233,6 @@ class UserGetUsersResponse(BaseModel):
16107
16233
  )
16108
16234
 
16109
16235
 
16110
- class UserSearchUsersResponse(BaseModel):
16111
- users: List[UserSearchUsersResponseUserInstance] = Field(
16112
- ..., description='Users in this organization.', title='Users'
16113
- )
16114
-
16115
-
16116
16236
  class SimulationUnitTestSetRunInstance(BaseModel):
16117
16237
  org_id: str = Field(..., title='Org Id')
16118
16238
  id: str = Field(..., title='Id')
@@ -16212,7 +16332,7 @@ class SimulationGetSimulationUnitTestSetRunsResponse(BaseModel):
16212
16332
 
16213
16333
 
16214
16334
  class ToolGetToolInvocationsResponse(BaseModel):
16215
- tool_invocations: List[ToolSearchToolInvocationsResponseToolInvocationInstance] = (
16335
+ tool_invocations: List[ToolGetToolInvocationsResponseToolInvocationInstance] = (
16216
16336
  Field(
16217
16337
  ..., description='The list of tool invocations.', title='Tool Invocations'
16218
16338
  )
@@ -16227,11 +16347,3 @@ class ToolGetToolInvocationsResponse(BaseModel):
16227
16347
  description='The continuation token to retrieve the next page of tool invocations, or null if there are no more tool invocations.',
16228
16348
  title='Continuation Token',
16229
16349
  )
16230
-
16231
-
16232
- class ToolSearchToolInvocationsResponse(BaseModel):
16233
- tool_invocations: List[ToolSearchToolInvocationsResponseToolInvocationInstance] = (
16234
- Field(
16235
- ..., description='The list of tool invocations.', title='Tool Invocations'
16236
- )
16237
- )
amigo_sdk/http_client.py CHANGED
@@ -6,7 +6,7 @@ import time
6
6
  from collections.abc import AsyncIterator, Iterator
7
7
  from dataclasses import dataclass
8
8
  from email.utils import parsedate_to_datetime
9
- from typing import Any, Optional
9
+ from typing import Any
10
10
 
11
11
  import httpx
12
12
 
@@ -82,7 +82,7 @@ class _RetryConfig:
82
82
  return random.uniform(0.0, window)
83
83
 
84
84
 
85
- def _should_refresh_token(token: Optional[UserSignInWithApiKeyResponse]) -> bool:
85
+ def _should_refresh_token(token: UserSignInWithApiKeyResponse | None) -> bool:
86
86
  if not token:
87
87
  return True
88
88
  return dt.datetime.now(dt.UTC) > token.expires_at - dt.timedelta(minutes=5)
@@ -133,7 +133,7 @@ class AmigoAsyncHttpClient:
133
133
  **httpx_kwargs: Any,
134
134
  ) -> None:
135
135
  self._cfg = cfg
136
- self._token: Optional[UserSignInWithApiKeyResponse] = None
136
+ self._token: UserSignInWithApiKeyResponse | None = None
137
137
  self._client = httpx.AsyncClient(
138
138
  base_url=cfg.base_url,
139
139
  **httpx_kwargs,
@@ -274,7 +274,7 @@ class AmigoHttpClient:
274
274
  **httpx_kwargs: Any,
275
275
  ) -> None:
276
276
  self._cfg = cfg
277
- self._token: Optional[UserSignInWithApiKeyResponse] = None
277
+ self._token: UserSignInWithApiKeyResponse | None = None
278
278
  self._client = httpx.Client(base_url=cfg.base_url, **httpx_kwargs)
279
279
  # Retry configuration
280
280
  self._retry_cfg = _RetryConfig(
@@ -48,7 +48,7 @@ class AsyncConversationResource:
48
48
  body: ConversationCreateConversationRequest,
49
49
  params: CreateConversationParametersQuery,
50
50
  abort_event: asyncio.Event | None = None,
51
- ) -> "AsyncGenerator[ConversationCreateConversationResponse, None]":
51
+ ) -> "AsyncGenerator[ConversationCreateConversationResponse]":
52
52
  """Create a new conversation and stream NDJSON events.
53
53
 
54
54
  Returns an async generator yielding `ConversationCreateConversationResponse` events.
@@ -77,7 +77,7 @@ class AsyncConversationResource:
77
77
  text_message: str | None = None,
78
78
  audio_bytes: bytes | None = None,
79
79
  audio_content_type: Literal["audio/mpeg", "audio/wav"] | None = None,
80
- ) -> "AsyncGenerator[ConversationInteractWithConversationResponse, None]":
80
+ ) -> "AsyncGenerator[ConversationInteractWithConversationResponse]":
81
81
  """Interact with a conversation and stream NDJSON events.
82
82
 
83
83
  Returns an async generator yielding `ConversationInteractWithConversationResponse` events.
@@ -1,5 +1,3 @@
1
- from typing import Optional
2
-
3
1
  from amigo_sdk.generated.model import (
4
2
  GetServicesParametersQuery,
5
3
  ServiceGetServicesResponse,
@@ -15,7 +13,7 @@ class AsyncServiceResource:
15
13
  self._organization_id = organization_id
16
14
 
17
15
  async def get_services(
18
- self, params: Optional[GetServicesParametersQuery] = None
16
+ self, params: GetServicesParametersQuery | None = None
19
17
  ) -> ServiceGetServicesResponse:
20
18
  """Get all services."""
21
19
  response = await self._http.request(
@@ -34,7 +32,7 @@ class ServiceResource:
34
32
  self._organization_id = organization_id
35
33
 
36
34
  def get_services(
37
- self, params: Optional[GetServicesParametersQuery] = None
35
+ self, params: GetServicesParametersQuery | None = None
38
36
  ) -> ServiceGetServicesResponse:
39
37
  response = self._http.request(
40
38
  "GET",
@@ -1,5 +1,3 @@
1
- from typing import Optional
2
-
3
1
  from amigo_sdk.generated.model import (
4
2
  GetUsersParametersQuery,
5
3
  UserCreateInvitedUserRequest,
@@ -18,7 +16,7 @@ class AsyncUserResource:
18
16
  self._organization_id = organization_id
19
17
 
20
18
  async def get_users(
21
- self, params: Optional[GetUsersParametersQuery] = None
19
+ self, params: GetUsersParametersQuery | None = None
22
20
  ) -> UserGetUsersResponse:
23
21
  """Get a list of users in the organization."""
24
22
  response = await self._http.request(
@@ -52,7 +50,7 @@ class AsyncUserResource:
52
50
  """Update user information. Returns None on success (e.g., 204)."""
53
51
  await self._http.request(
54
52
  "POST",
55
- f"/v1/{self._organization_id}/user/{user_id}/user",
53
+ f"/v1/{self._organization_id}/user/{user_id}",
56
54
  json=body.model_dump(mode="json", exclude_none=True),
57
55
  )
58
56
 
@@ -65,7 +63,7 @@ class UserResource:
65
63
  self._organization_id = organization_id
66
64
 
67
65
  def get_users(
68
- self, params: Optional[GetUsersParametersQuery] = None
66
+ self, params: GetUsersParametersQuery | None = None
69
67
  ) -> UserGetUsersResponse:
70
68
  response = self._http.request(
71
69
  "GET",
@@ -92,6 +90,6 @@ class UserResource:
92
90
  def update_user(self, user_id: str, body: UserUpdateUserInfoRequest) -> None:
93
91
  self._http.request(
94
92
  "POST",
95
- f"/v1/{self._organization_id}/user/{user_id}/user",
93
+ f"/v1/{self._organization_id}/user/{user_id}",
96
94
  json=body.model_dump(mode="json", exclude_none=True),
97
95
  )
amigo_sdk/sdk_client.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Any, Optional
1
+ from typing import Any
2
2
 
3
3
  from amigo_sdk.config import AmigoConfig
4
4
  from amigo_sdk.http_client import AmigoAsyncHttpClient, AmigoHttpClient
@@ -20,12 +20,12 @@ class AsyncAmigoClient:
20
20
  def __init__(
21
21
  self,
22
22
  *,
23
- api_key: Optional[str] = None,
24
- api_key_id: Optional[str] = None,
25
- user_id: Optional[str] = None,
26
- organization_id: Optional[str] = None,
27
- base_url: Optional[str] = None,
28
- config: Optional[AmigoConfig] = None,
23
+ api_key: str | None = None,
24
+ api_key_id: str | None = None,
25
+ user_id: str | None = None,
26
+ organization_id: str | None = None,
27
+ base_url: str | None = None,
28
+ config: AmigoConfig | None = None,
29
29
  **httpx_kwargs: Any,
30
30
  ):
31
31
  """
@@ -119,12 +119,12 @@ class AmigoClient:
119
119
  def __init__(
120
120
  self,
121
121
  *,
122
- api_key: Optional[str] = None,
123
- api_key_id: Optional[str] = None,
124
- user_id: Optional[str] = None,
125
- organization_id: Optional[str] = None,
126
- base_url: Optional[str] = None,
127
- config: Optional[AmigoConfig] = None,
122
+ api_key: str | None = None,
123
+ api_key_id: str | None = None,
124
+ user_id: str | None = None,
125
+ organization_id: str | None = None,
126
+ base_url: str | None = None,
127
+ config: AmigoConfig | None = None,
128
128
  **httpx_kwargs: Any,
129
129
  ):
130
130
  if config:
@@ -1,11 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amigo_sdk
3
- Version: 0.58.0
3
+ Version: 0.67.0
4
4
  Summary: Amigo AI Python SDK
5
5
  Author: Amigo AI
6
6
  License-File: LICENSE
7
7
  Classifier: Programming Language :: Python :: 3
8
- Requires-Python: >=3.9
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Requires-Python: >=3.13
9
11
  Requires-Dist: email-validator<3.0,>=2.0
10
12
  Requires-Dist: httpx<1.0,>=0.25
11
13
  Requires-Dist: pydantic-settings<3.0,>=2.0
@@ -30,6 +32,8 @@ The official Python SDK for the Amigo API, providing a simple and intuitive inte
30
32
 
31
33
  ## Installation
32
34
 
35
+ This SDK requires Python 3.13 or newer.
36
+
33
37
  Install the SDK using pip:
34
38
 
35
39
  ```bash
@@ -0,0 +1,18 @@
1
+ amigo_sdk/__init__.py,sha256=_Vt20XUAV719JwAfR87fdDdt_AzUTzcNx0cHi5VVTdA,139
2
+ amigo_sdk/_retry_utils.py,sha256=VbA_Uwv268J80d11R9XfnCjZiV-NwE1aXRsSlRjjRio,2108
3
+ amigo_sdk/auth.py,sha256=WaM9PcEcnaC6CzNsgRKueHkdSAxNbRylzpR_3Q6guQ0,1765
4
+ amigo_sdk/config.py,sha256=0eZIo-hcJ8ODftKAr-mwB-FGJxGO5PT5T4dRpyWPqAg,1491
5
+ amigo_sdk/errors.py,sha256=Yn12AxIQ6zE9jnGLWO0MUVbBsmw77Kzh82AijyreOkA,4818
6
+ amigo_sdk/http_client.py,sha256=tfMXHqMTmlz2ja7aJhOVgbwAiJNlKCzPcK4UGNqXHO8,13488
7
+ amigo_sdk/models.py,sha256=V-G6iL43_ZNOPDcatCJCSszGWGz-nzp_RSyGNm-rBAc,45
8
+ amigo_sdk/sdk_client.py,sha256=5nj8hzjHSFRs9JMNabdYIhQAcFE2G1jI_r7SHVGr9No,6106
9
+ amigo_sdk/generated/model.py,sha256=byPdfHdBjkFPxltnyGsxQEo1yl8pF9x53IIF_OKJWzE,456940
10
+ amigo_sdk/resources/conversation.py,sha256=u4kOx5LPbhX92L41UnmPmaF9TkQA5bGev8N00dMoP9I,14805
11
+ amigo_sdk/resources/organization.py,sha256=yX4UlOHNegRzFW4gCJrCxjiLCAGnGegasjviR1yad_Q,1211
12
+ amigo_sdk/resources/service.py,sha256=t1iA3nS9co-wuR-x5jBhAXXTWfMeGsLwfQcLycwVrCA,1536
13
+ amigo_sdk/resources/user.py,sha256=zikijiuGXgmkBVtrldor6XQGQK6jWXonDvNFuQs6XK4,3472
14
+ amigo_sdk-0.67.0.dist-info/METADATA,sha256=qTyi_Kit19ZHi0PkFa6POvNZDZOoiBvsCCnetJZc40s,8499
15
+ amigo_sdk-0.67.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
16
+ amigo_sdk-0.67.0.dist-info/entry_points.txt,sha256=ivKZ8S9W6SH796zUDHeM-qHodrwmkmUItophi-jJWK0,82
17
+ amigo_sdk-0.67.0.dist-info/licenses/LICENSE,sha256=tx3FiTVbGxwBUOxQbNh05AAQlC2jd5hGvNpIkSfVbCo,1062
18
+ amigo_sdk-0.67.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,18 +0,0 @@
1
- amigo_sdk/__init__.py,sha256=eq0nI8emjzOuEhNVbyTq62mVm0ZxwgblB4dS5i2zHJo,139
2
- amigo_sdk/_retry_utils.py,sha256=kFjw9Wqye6MB5-B4rjLxsbSNcfYBIztcollIoncd1hY,2142
3
- amigo_sdk/auth.py,sha256=WaM9PcEcnaC6CzNsgRKueHkdSAxNbRylzpR_3Q6guQ0,1765
4
- amigo_sdk/config.py,sha256=0eZIo-hcJ8ODftKAr-mwB-FGJxGO5PT5T4dRpyWPqAg,1491
5
- amigo_sdk/errors.py,sha256=RkRyF5eAASd8fIOS6YvL9rLDvLAYWqHfpHSCR7jqvl4,4840
6
- amigo_sdk/http_client.py,sha256=v25UoUbXcMeHTnfJMcrl8RSSwCVkKUL1Jv-0HoXP1B4,13507
7
- amigo_sdk/models.py,sha256=V-G6iL43_ZNOPDcatCJCSszGWGz-nzp_RSyGNm-rBAc,45
8
- amigo_sdk/sdk_client.py,sha256=Kr9M9o66pOLu0T2VDvqdYMmPZzgKJyTELu7BSPgGrYQ,6152
9
- amigo_sdk/generated/model.py,sha256=IJY4qg5iX34qf66twvrTeQ8Pg61C0zwwRfftVbfaLoc,452416
10
- amigo_sdk/resources/conversation.py,sha256=5PkJOvLKqnriSS9K9hKw2VRPxRLTuABEbCyPy1fz1r0,14817
11
- amigo_sdk/resources/organization.py,sha256=yX4UlOHNegRzFW4gCJrCxjiLCAGnGegasjviR1yad_Q,1211
12
- amigo_sdk/resources/service.py,sha256=SiwEHXCQk4r1b_tGv47M08VuB7RALDHJQzWlpuD937g,1571
13
- amigo_sdk/resources/user.py,sha256=vZPCw8i-xvcDQik8ouJbm8qVHucRbfxCWI3yYMDj8hg,3517
14
- amigo_sdk-0.58.0.dist-info/METADATA,sha256=ze-715fj09NNtJRWplnwVN6aBrPb64apadF31J8Hi3U,8350
15
- amigo_sdk-0.58.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- amigo_sdk-0.58.0.dist-info/entry_points.txt,sha256=ivKZ8S9W6SH796zUDHeM-qHodrwmkmUItophi-jJWK0,82
17
- amigo_sdk-0.58.0.dist-info/licenses/LICENSE,sha256=tx3FiTVbGxwBUOxQbNh05AAQlC2jd5hGvNpIkSfVbCo,1062
18
- amigo_sdk-0.58.0.dist-info/RECORD,,