maitai-python 1.1.8__tar.gz → 1.1.9b0__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 (48) hide show
  1. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/PKG-INFO +1 -1
  2. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_utils.py +3 -1
  3. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/tools/__init__.py +5 -1
  4. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/version.py +1 -1
  5. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/chat/__init__.py +13 -0
  6. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/sentinel/__init__.py +14 -0
  7. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_python.egg-info/PKG-INFO +1 -1
  8. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/README.md +0 -0
  9. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/__init__.py +0 -0
  10. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_azure.py +0 -0
  11. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_config.py +0 -0
  12. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_config_listener_thread.py +0 -0
  13. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_context.py +0 -0
  14. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_evaluator.py +0 -0
  15. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_inference.py +0 -0
  16. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_maitai.py +0 -0
  17. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_maitai_async.py +0 -0
  18. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_maitai_client.py +0 -0
  19. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai/_types.py +0 -0
  20. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/__init__.py +0 -0
  21. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/config/__init__.py +0 -0
  22. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/config/config_service.py +0 -0
  23. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/processes/__init__.py +0 -0
  24. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/processes/io_thread.py +0 -0
  25. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/processes/websocket_listener_thread.py +0 -0
  26. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/utils/__init__.py +0 -0
  27. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/utils/proto_utils.py +0 -0
  28. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_common/utils/types.py +0 -0
  29. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/__init__.py +0 -0
  30. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/application/__init__.py +0 -0
  31. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/backtest/__init__.py +0 -0
  32. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/company/__init__.py +0 -0
  33. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/config/__init__.py +0 -0
  34. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/embedding/__init__.py +0 -0
  35. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/event/__init__.py +0 -0
  36. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/inference/__init__.py +0 -0
  37. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/key/__init__.py +0 -0
  38. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/metric/__init__.py +0 -0
  39. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/model/__init__.py +0 -0
  40. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/notification/__init__.py +0 -0
  41. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/sandbox/__init__.py +0 -0
  42. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_gen/session/__init__.py +0 -0
  43. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_python.egg-info/SOURCES.txt +0 -0
  44. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_python.egg-info/dependency_links.txt +0 -0
  45. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_python.egg-info/requires.txt +0 -0
  46. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/maitai_python.egg-info/top_level.txt +0 -0
  47. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/setup.cfg +0 -0
  48. {maitai_python-1.1.8 → maitai_python-1.1.9b0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maitai-python
3
- Version: 1.1.8
3
+ Version: 1.1.9b0
4
4
  Summary: Maitai SDK for Python
5
5
  Home-page: https://docs.trymaitai.ai
6
6
  Author: Maitai
@@ -110,7 +110,7 @@ def get_chat_completion_params(*,
110
110
  max_tokens: Union[Optional[int], openai.NotGiven] = openai.NOT_GIVEN,
111
111
  n: Union[Optional[int], openai.NotGiven] = openai.NOT_GIVEN,
112
112
  presence_penalty: Union[Optional[float], openai.NotGiven] = openai.NOT_GIVEN,
113
- response_format: Union[openai_types.completion_create_params.ResponseFormat, openai.NotGiven] = openai.NOT_GIVEN,
113
+ response_format: Union[openai_types.completion_create_params.ResponseFormat, chat_types.ResponseFormat, openai.NotGiven] = openai.NOT_GIVEN,
114
114
  seed: Union[Optional[int], openai.NotGiven] = openai.NOT_GIVEN,
115
115
  stop: Union[Union[Optional[str], List[str]], openai.NotGiven] = openai.NOT_GIVEN,
116
116
  stream: Optional[bool] = False,
@@ -153,6 +153,8 @@ def get_chat_completion_params(*,
153
153
 
154
154
  if response_format != openai.NOT_GIVEN:
155
155
  params.response_format = chat_types.ResponseFormat(type=response_format["type"])
156
+ if response_format.get("json_schema"):
157
+ params.response_format.json_schema = chat_types.JsonSchema().from_dict(response_format["json_schema"])
156
158
 
157
159
  if tools != openai.NOT_GIVEN:
158
160
  params.tools = []
@@ -31,7 +31,10 @@ class Tools:
31
31
  return function_response
32
32
 
33
33
 
34
- def tool(func):
34
+ def tool(func=None, strict=True):
35
+ if func is None:
36
+ return lambda f: tool(f, strict=strict)
37
+
35
38
  function_description = func.__doc__
36
39
  if not function_description:
37
40
  raise ValueError("Missing docstring for tool")
@@ -68,6 +71,7 @@ def tool(func):
68
71
  type="function",
69
72
  function=Function(
70
73
  name=func.__name__,
74
+ strict=strict,
71
75
  description=function_description,
72
76
  parameters={
73
77
  "type": "object",
@@ -1,3 +1,3 @@
1
- version = "1.1.8"
1
+ version = "1.1.9b0"
2
2
  if __name__ == "__main__":
3
3
  print(version)
@@ -122,6 +122,9 @@ class ChatCompletionParams(betterproto.Message):
122
122
  @dataclass(eq=False, repr=False)
123
123
  class ResponseFormat(betterproto.Message):
124
124
  type: str = betterproto.string_field(1)
125
+ json_schema: Optional["JsonSchema"] = betterproto.message_field(
126
+ 2, optional=True, group="_json_schema"
127
+ )
125
128
 
126
129
 
127
130
  @dataclass(eq=False, repr=False)
@@ -142,6 +145,16 @@ class Function(betterproto.Message):
142
145
  parameters: Dict[str, str] = betterproto.map_field(
143
146
  3, betterproto.TYPE_STRING, betterproto.TYPE_STRING
144
147
  )
148
+ strict: bool = betterproto.bool_field(4)
149
+
150
+
151
+ @dataclass(eq=False, repr=False)
152
+ class JsonSchema(betterproto.Message):
153
+ name: str = betterproto.string_field(1)
154
+ strict: bool = betterproto.bool_field(2)
155
+ schema: Dict[str, str] = betterproto.map_field(
156
+ 3, betterproto.TYPE_STRING, betterproto.TYPE_STRING
157
+ )
145
158
 
146
159
 
147
160
  @dataclass(eq=False, repr=False)
@@ -32,6 +32,7 @@ class Sentinel(betterproto.Message):
32
32
  meta: Dict[str, str] = betterproto.map_field(
33
33
  9, betterproto.TYPE_STRING, betterproto.TYPE_STRING
34
34
  )
35
+ sentinel_generation_id: int = betterproto.int64_field(10)
35
36
 
36
37
 
37
38
  @dataclass(eq=False, repr=False)
@@ -53,3 +54,16 @@ class DirectiveBody(betterproto.Message):
53
54
  class SentinelExample(betterproto.Message):
54
55
  example_type: str = betterproto.string_field(1)
55
56
  example_body: str = betterproto.string_field(2)
57
+
58
+
59
+ @dataclass(eq=False, repr=False)
60
+ class SentinelGeneration(betterproto.Message):
61
+ id: int = betterproto.int64_field(1)
62
+ date_created: int = betterproto.int64_field(2)
63
+ company_id: int = betterproto.int64_field(3)
64
+ application_id: int = betterproto.int64_field(4)
65
+ application_action_id: int = betterproto.int64_field(5)
66
+ base_prompt: str = betterproto.string_field(6)
67
+ meta: Dict[str, str] = betterproto.map_field(
68
+ 7, betterproto.TYPE_STRING, betterproto.TYPE_STRING
69
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maitai-python
3
- Version: 1.1.8
3
+ Version: 1.1.9b0
4
4
  Summary: Maitai SDK for Python
5
5
  Home-page: https://docs.trymaitai.ai
6
6
  Author: Maitai
File without changes
File without changes
File without changes