maitai-python 1.1.8b0__tar.gz → 1.1.9__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.
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/PKG-INFO +1 -1
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_utils.py +3 -1
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/tools/__init__.py +7 -3
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/version.py +1 -1
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/chat/__init__.py +24 -1
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/sentinel/__init__.py +14 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/README.md +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_azure.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_config.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_context.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_evaluator.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_inference.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_maitai.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_maitai_async.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai/_types.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/utils/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/utils/proto_utils.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/utils/types.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/backtest/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/embedding/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/event/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/metric/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/model/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/setup.cfg +0 -0
- {maitai_python-1.1.8b0 → maitai_python-1.1.9}/setup.py +0 -0
|
@@ -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")
|
|
@@ -61,18 +64,19 @@ def tool(func):
|
|
|
61
64
|
"type": _parse_type(param_type),
|
|
62
65
|
"description": param_descriptions.get(param_name, ""),
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
required.append(param_name)
|
|
67
|
+
required.append(param_name)
|
|
66
68
|
|
|
67
69
|
wrapper.__tool__ = Tool(
|
|
68
70
|
type="function",
|
|
69
71
|
function=Function(
|
|
70
72
|
name=func.__name__,
|
|
73
|
+
strict=strict,
|
|
71
74
|
description=function_description,
|
|
72
75
|
parameters={
|
|
73
76
|
"type": "object",
|
|
74
77
|
"properties": properties,
|
|
75
78
|
"required": required,
|
|
79
|
+
"additionalProperties": False,
|
|
76
80
|
},
|
|
77
81
|
)
|
|
78
82
|
)
|
|
@@ -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)
|
|
@@ -206,6 +219,7 @@ class ChatCompletionMessage(betterproto.Message):
|
|
|
206
219
|
3, optional=True, group="_function_call"
|
|
207
220
|
)
|
|
208
221
|
tool_calls: List["ToolCall"] = betterproto.message_field(4)
|
|
222
|
+
refusal: str = betterproto.string_field(5)
|
|
209
223
|
|
|
210
224
|
|
|
211
225
|
@dataclass(eq=False, repr=False)
|
|
@@ -252,6 +266,7 @@ class ChoiceDelta(betterproto.Message):
|
|
|
252
266
|
role: str = betterproto.string_field(2)
|
|
253
267
|
tool_calls: List["ToolCall"] = betterproto.message_field(3)
|
|
254
268
|
function_call: "FunctionCall" = betterproto.message_field(4)
|
|
269
|
+
refusal: str = betterproto.string_field(6)
|
|
255
270
|
|
|
256
271
|
|
|
257
272
|
@dataclass(eq=False, repr=False)
|
|
@@ -271,6 +286,7 @@ class ToolCallFunction(betterproto.Message):
|
|
|
271
286
|
@dataclass(eq=False, repr=False)
|
|
272
287
|
class LogProbs(betterproto.Message):
|
|
273
288
|
content: List["LogPropsContent"] = betterproto.message_field(1)
|
|
289
|
+
refusal: List["LogPropsContent"] = betterproto.message_field(2)
|
|
274
290
|
|
|
275
291
|
|
|
276
292
|
@dataclass(eq=False, repr=False)
|
|
@@ -278,7 +294,14 @@ class LogPropsContent(betterproto.Message):
|
|
|
278
294
|
token: str = betterproto.string_field(1)
|
|
279
295
|
logprob: float = betterproto.double_field(2)
|
|
280
296
|
bytes: List[int] = betterproto.int32_field(3)
|
|
281
|
-
top_logprobs: List["
|
|
297
|
+
top_logprobs: List["TopLogProbs"] = betterproto.message_field(4)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
@dataclass(eq=False, repr=False)
|
|
301
|
+
class TopLogProbs(betterproto.Message):
|
|
302
|
+
token: str = betterproto.string_field(1)
|
|
303
|
+
logprob: float = betterproto.double_field(2)
|
|
304
|
+
bytes: List[float] = betterproto.double_field(3)
|
|
282
305
|
|
|
283
306
|
|
|
284
307
|
@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
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maitai_python-1.1.8b0 → maitai_python-1.1.9}/maitai_common/processes/websocket_listener_thread.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|