maitai-python 1.0.38b0__tar.gz → 1.0.39__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.0.38b0 → maitai_python-1.0.39}/PKG-INFO +1 -1
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_inference.py +2 -8
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_maitai.py +39 -10
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_maitai_async.py +38 -12
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_maitai_client.py +5 -2
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_types.py +6 -3
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/processes/websocket_listener_thread.py +1 -1
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/version.py +1 -1
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/application/__init__.py +1 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/chat/__init__.py +26 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/README.md +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_azure.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_config.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_context.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_evaluator.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai/_utils.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/utils/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/utils/proto_utils.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/utils/types.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/embedding/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/event/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/model/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/sentinel/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/setup.cfg +0 -0
- {maitai_python-1.0.38b0 → maitai_python-1.0.39}/setup.py +0 -0
|
@@ -29,10 +29,7 @@ class Inference(MaitaiClient):
|
|
|
29
29
|
super().__init__()
|
|
30
30
|
|
|
31
31
|
@classmethod
|
|
32
|
-
def infer(cls,
|
|
33
|
-
timeout=None, context_retrieval_enabled=False, context_query='', return_request=False, fallback_model=None, user_id: str = "") -> Iterable[InferenceStreamResponse]:
|
|
34
|
-
chat_request: ChatCompletionRequest = cls.create_inference_request(application_ref_name, session_id, reference_id, intent, apply_corrections, evaluation_enabled, completion_params, evaluate_callback,
|
|
35
|
-
context_retrieval_enabled, context_query, return_request, fallback_model, user_id)
|
|
32
|
+
def infer(cls, chat_request: ChatCompletionRequest, evaluate_callback, timeout) -> Iterable[InferenceStreamResponse]:
|
|
36
33
|
if evaluate_callback:
|
|
37
34
|
q = ChunkQueue()
|
|
38
35
|
cls.run_async(cls.send_inference_request_async(chat_request, chunk_queue=q, evaluation_callback=evaluate_callback))
|
|
@@ -41,10 +38,7 @@ class Inference(MaitaiClient):
|
|
|
41
38
|
return cls.send_inference_request(chat_request)
|
|
42
39
|
|
|
43
40
|
@classmethod
|
|
44
|
-
async def infer_async(cls,
|
|
45
|
-
evaluate_callback: EvaluateCallback = None, timeout=None, context_retrieval_enabled=False, context_query='', fallback_model=None, user_id="") -> AsyncIterable[InferenceStreamResponse]:
|
|
46
|
-
chat_request: ChatCompletionRequest = cls.create_inference_request(application_ref_name, session_id, reference_id, intent, apply_corrections, evaluation_enabled, completion_params, evaluate_callback,
|
|
47
|
-
context_retrieval_enabled, context_query, fallback_model, user_id)
|
|
41
|
+
async def infer_async(cls, chat_request: ChatCompletionRequest, evaluate_callback, timeout) -> AsyncIterable[InferenceStreamResponse]:
|
|
48
42
|
q = AsyncChunkQueue()
|
|
49
43
|
cls.run_async(cls.send_inference_request_async(chat_request, async_chunk_queue=q, evaluation_callback=evaluate_callback))
|
|
50
44
|
return QueueIterable(q, timeout=timeout)
|
|
@@ -16,7 +16,7 @@ from maitai._types import Body, Headers, MaitaiChunk, MaitaiCompletion, Query
|
|
|
16
16
|
from maitai._utils import convert_open_ai_chat_completion_chunk, convert_openai_chat_completion, get_chat_completion_params, required_args
|
|
17
17
|
from maitai_common.utils.proto_utils import openai_messages_to_proto
|
|
18
18
|
from maitai_common.utils.types import EvaluateCallback
|
|
19
|
-
from maitai_gen.chat import ChatCompletionParams, ChatMessage, EvaluationContentType
|
|
19
|
+
from maitai_gen.chat import ChatCompletionParams, ChatCompletionRequest, ChatMessage, ClientParams, EvaluationContentType
|
|
20
20
|
from maitai_gen.config import InferenceLocations
|
|
21
21
|
from maitai_gen.inference import InferenceStreamResponse
|
|
22
22
|
|
|
@@ -71,17 +71,25 @@ class Maitai:
|
|
|
71
71
|
http_client=http_client,
|
|
72
72
|
_strict_response_validation=_strict_response_validation,
|
|
73
73
|
)
|
|
74
|
-
|
|
74
|
+
client_params = None
|
|
75
|
+
if base_url or default_headers or default_query:
|
|
76
|
+
client_params = ClientParams(
|
|
77
|
+
base_url=base_url or "",
|
|
78
|
+
default_headers=default_headers or {},
|
|
79
|
+
default_query=default_query or {},
|
|
80
|
+
)
|
|
81
|
+
self.chat = Chat(self.client, client_params)
|
|
75
82
|
|
|
76
83
|
|
|
77
84
|
class Chat:
|
|
78
|
-
def __init__(self, client=None):
|
|
79
|
-
self.completions = Completions(client)
|
|
85
|
+
def __init__(self, client=None, client_params: ClientParams = None):
|
|
86
|
+
self.completions = Completions(client, client_params)
|
|
80
87
|
|
|
81
88
|
|
|
82
89
|
class Completions:
|
|
83
|
-
def __init__(self, client: Optional[openai.Client] = None):
|
|
90
|
+
def __init__(self, client: Optional[openai.Client] = None, client_params: Optional[ClientParams] = None):
|
|
84
91
|
self.client = client
|
|
92
|
+
self.client_params = client_params or ClientParams()
|
|
85
93
|
|
|
86
94
|
@required_args(["session_id", "action_type", "application_ref_name", "messages"],
|
|
87
95
|
["session_id", "intent", "application_ref_name", "messages"],
|
|
@@ -107,6 +115,7 @@ class Completions:
|
|
|
107
115
|
context_query: str = '',
|
|
108
116
|
return_request: bool = False,
|
|
109
117
|
fallback_model: str = None,
|
|
118
|
+
assistant: bool = False,
|
|
110
119
|
# OpenAI Arguments
|
|
111
120
|
messages: Iterable[openai_chat_types.ChatCompletionMessageParam],
|
|
112
121
|
model: Union[str, openai_types.ChatModel, openai.NotGiven] = openai.NOT_GIVEN,
|
|
@@ -200,22 +209,42 @@ class Completions:
|
|
|
200
209
|
response_timeout = None
|
|
201
210
|
if isinstance(timeout, float) or isinstance(timeout, int):
|
|
202
211
|
response_timeout = timeout
|
|
203
|
-
|
|
204
|
-
|
|
212
|
+
chat_request: ChatCompletionRequest = maitai.Inference.create_inference_request(
|
|
213
|
+
application_ref_name=application_ref_name,
|
|
214
|
+
session_id=session_id,
|
|
215
|
+
reference_id=reference_id,
|
|
216
|
+
intent=intent,
|
|
217
|
+
apply_corrections=apply_corrections,
|
|
218
|
+
evaluation_enabled=evaluation_enabled,
|
|
219
|
+
completion_params=completion_params,
|
|
220
|
+
callback=callback,
|
|
221
|
+
context_retrieval_enabled=context_retrieval_enabled,
|
|
222
|
+
context_query=context_query,
|
|
223
|
+
return_request=return_request,
|
|
224
|
+
fallback_model=fallback_model,
|
|
225
|
+
user_id=user_id,
|
|
226
|
+
assistant=assistant,
|
|
227
|
+
client_params=self.client_params,
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
response = maitai.Inference.infer(chat_request, callback, response_timeout)
|
|
205
231
|
if stream:
|
|
206
232
|
return _process_inference_stream(response)
|
|
207
233
|
# ChatCompletion only
|
|
208
|
-
chat_completion: Optional[MaitaiCompletion] = None
|
|
209
234
|
for resp in response:
|
|
210
235
|
if resp.warning:
|
|
211
236
|
warnings.warn(resp.warning, InferenceWarning)
|
|
212
237
|
if resp.error:
|
|
213
238
|
raise InferenceException(resp.error)
|
|
214
239
|
return MaitaiCompletion(resp.chat_completion_response)
|
|
215
|
-
|
|
240
|
+
raise InferenceException("No data received")
|
|
216
241
|
else:
|
|
217
242
|
if self.client is None:
|
|
218
|
-
self.client = openai.OpenAI(
|
|
243
|
+
self.client = openai.OpenAI(
|
|
244
|
+
default_query=self.client_params.default_query or None,
|
|
245
|
+
default_headers=self.client_params.default_headers or None,
|
|
246
|
+
base_url=self.client_params.base_url or None,
|
|
247
|
+
)
|
|
219
248
|
response = self.client.chat.completions.create(
|
|
220
249
|
messages=messages,
|
|
221
250
|
model=model,
|
|
@@ -15,7 +15,7 @@ from maitai._types import Body, Headers, MaitaiChunk, MaitaiCompletion, Query
|
|
|
15
15
|
from maitai._utils import convert_open_ai_chat_completion_chunk, convert_openai_chat_completion, get_chat_completion_params, required_args
|
|
16
16
|
from maitai_common.utils.proto_utils import openai_messages_to_proto
|
|
17
17
|
from maitai_common.utils.types import EvaluateCallback
|
|
18
|
-
from maitai_gen.chat import ChatCompletionParams, ChatMessage, EvaluationContentType
|
|
18
|
+
from maitai_gen.chat import ChatCompletionParams, ChatCompletionRequest, ChatMessage, ClientParams, EvaluationContentType
|
|
19
19
|
from maitai_gen.config import InferenceLocations
|
|
20
20
|
from maitai_gen.inference import InferenceStreamResponse
|
|
21
21
|
|
|
@@ -70,19 +70,25 @@ class MaitaiAsync:
|
|
|
70
70
|
_strict_response_validation=_strict_response_validation,
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
client_params = None
|
|
74
|
+
if base_url or default_headers or default_query:
|
|
75
|
+
client_params = ClientParams(
|
|
76
|
+
base_url=base_url or "",
|
|
77
|
+
default_headers=default_headers or {},
|
|
78
|
+
default_query=default_query or {},
|
|
79
|
+
)
|
|
80
|
+
self.chat = AsyncChat(self.client, client_params)
|
|
74
81
|
|
|
75
82
|
|
|
76
83
|
class AsyncChat:
|
|
77
|
-
def __init__(self, client=None):
|
|
78
|
-
self.completions = AsyncCompletions(client)
|
|
84
|
+
def __init__(self, client=None, client_params: ClientParams = None):
|
|
85
|
+
self.completions = AsyncCompletions(client, client_params)
|
|
79
86
|
|
|
80
87
|
|
|
81
88
|
class AsyncCompletions:
|
|
82
|
-
def __init__(self, client: Optional[openai.AsyncClient] = None):
|
|
83
|
-
if client is None:
|
|
84
|
-
client = openai.AsyncClient()
|
|
89
|
+
def __init__(self, client: Optional[openai.AsyncClient] = None, client_params: Optional[ClientParams] = None):
|
|
85
90
|
self.client = client
|
|
91
|
+
self.client_params = client_params or ClientParams()
|
|
86
92
|
|
|
87
93
|
@required_args(["session_id", "action_type", "application_ref_name", "messages"],
|
|
88
94
|
["session_id", "intent", "application_ref_name", "messages"],
|
|
@@ -107,6 +113,7 @@ class AsyncCompletions:
|
|
|
107
113
|
context_retrieval_enabled: bool = None,
|
|
108
114
|
context_query: str = None,
|
|
109
115
|
fallback_model: str = None,
|
|
116
|
+
assistant: bool = False,
|
|
110
117
|
# OpenAI Arguments
|
|
111
118
|
messages: Iterable[openai_chat_types.ChatCompletionMessageParam],
|
|
112
119
|
model: Union[str, openai_types.ChatModel, openai.NotGiven] = openai.NOT_GIVEN,
|
|
@@ -201,22 +208,41 @@ class AsyncCompletions:
|
|
|
201
208
|
response_timeout = None
|
|
202
209
|
if isinstance(timeout, float) or isinstance(timeout, int):
|
|
203
210
|
response_timeout = timeout
|
|
204
|
-
|
|
205
|
-
|
|
211
|
+
chat_request: ChatCompletionRequest = maitai.Inference.create_inference_request(
|
|
212
|
+
application_ref_name=application_ref_name,
|
|
213
|
+
session_id=session_id,
|
|
214
|
+
reference_id=reference_id,
|
|
215
|
+
intent=intent,
|
|
216
|
+
apply_corrections=apply_corrections,
|
|
217
|
+
evaluation_enabled=evaluation_enabled,
|
|
218
|
+
completion_params=completion_params,
|
|
219
|
+
callback=callback,
|
|
220
|
+
context_retrieval_enabled=context_retrieval_enabled,
|
|
221
|
+
context_query=context_query,
|
|
222
|
+
return_request=False,
|
|
223
|
+
fallback_model=fallback_model,
|
|
224
|
+
user_id=user_id,
|
|
225
|
+
assistant=assistant,
|
|
226
|
+
client_params=self.client_params,
|
|
227
|
+
)
|
|
228
|
+
response = await maitai.Inference.infer_async(chat_request, callback, response_timeout)
|
|
206
229
|
if stream:
|
|
207
230
|
return _process_inference_stream_async(response)
|
|
208
231
|
# ChatCompletion only
|
|
209
|
-
chat_completion: Optional[MaitaiCompletion] = None
|
|
210
232
|
async for resp in response:
|
|
211
233
|
if resp.warning:
|
|
212
234
|
warnings.warn(resp.warning, InferenceWarning)
|
|
213
235
|
if resp.error:
|
|
214
236
|
raise InferenceException(resp.error)
|
|
215
237
|
return MaitaiCompletion(resp.chat_completion_response)
|
|
216
|
-
|
|
238
|
+
raise InferenceException("No data received")
|
|
217
239
|
else:
|
|
218
240
|
if self.client is None:
|
|
219
|
-
self.client = openai.
|
|
241
|
+
self.client = openai.AsyncOpenAI(
|
|
242
|
+
default_headers=self.client_params.default_headers or None,
|
|
243
|
+
default_query=self.client_params.default_query or None,
|
|
244
|
+
base_url=self.client_params.base_url or None,
|
|
245
|
+
)
|
|
220
246
|
response = await self.client.chat.completions.create(
|
|
221
247
|
messages=messages,
|
|
222
248
|
model=model,
|
|
@@ -2,7 +2,7 @@ import asyncio
|
|
|
2
2
|
import threading
|
|
3
3
|
|
|
4
4
|
from maitai._config import config
|
|
5
|
-
from maitai_gen.chat import ChatCompletionParams, ChatCompletionRequest
|
|
5
|
+
from maitai_gen.chat import ChatCompletionParams, ChatCompletionRequest, ClientParams
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class MaitaiClient:
|
|
@@ -36,7 +36,7 @@ class MaitaiClient:
|
|
|
36
36
|
|
|
37
37
|
@classmethod
|
|
38
38
|
def create_inference_request(cls, application_ref_name, session_id, reference_id, intent, apply_corrections, evaluation_enabled, completion_params: ChatCompletionParams, callback=None,
|
|
39
|
-
context_retrieval_enabled=False, context_query=None, return_request=False, fallback_model=None, user_id=""):
|
|
39
|
+
context_retrieval_enabled=False, context_query=None, return_request=False, fallback_model=None, user_id="", assistant=False, client_params: ClientParams = None):
|
|
40
40
|
infer_request: ChatCompletionRequest = ChatCompletionRequest()
|
|
41
41
|
infer_request.application_ref_name = application_ref_name
|
|
42
42
|
infer_request.reference_id = reference_id
|
|
@@ -52,4 +52,7 @@ class MaitaiClient:
|
|
|
52
52
|
infer_request.return_request = return_request
|
|
53
53
|
infer_request.fallback_model = fallback_model
|
|
54
54
|
infer_request.user_id = user_id
|
|
55
|
+
infer_request.assistant = assistant
|
|
56
|
+
if client_params is not None:
|
|
57
|
+
infer_request.client_params = client_params
|
|
55
58
|
return infer_request
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
from datetime import datetime
|
|
2
3
|
from typing import Mapping, Union
|
|
3
4
|
|
|
@@ -5,7 +6,7 @@ import openai.types.chat as openai_chat_types
|
|
|
5
6
|
from betterproto import Casing
|
|
6
7
|
from typing_extensions import Literal
|
|
7
8
|
|
|
8
|
-
from maitai_gen.chat import ChatCompletionChunk, ChatCompletionResponse, EvaluateRequest, EvaluateResponse
|
|
9
|
+
from maitai_gen.chat import ChatCompletionChunk, ChatCompletionRequest, ChatCompletionResponse, EvaluateRequest, EvaluateResponse
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Omit:
|
|
@@ -27,7 +28,7 @@ class MaitaiChunk(ChatCompletionChunk):
|
|
|
27
28
|
self.from_pydict(chat_completion_chunk.to_pydict())
|
|
28
29
|
|
|
29
30
|
def model_dump_json(self):
|
|
30
|
-
return self.to_pydict(casing=Casing.SNAKE)
|
|
31
|
+
return json.dumps(self.to_pydict(casing=Casing.SNAKE))
|
|
31
32
|
|
|
32
33
|
def openai_dump_json(self):
|
|
33
34
|
data = self.to_pydict(casing=Casing.SNAKE)
|
|
@@ -61,10 +62,12 @@ class MaitaiCompletion(ChatCompletionResponse):
|
|
|
61
62
|
if chat_completion_response is not None:
|
|
62
63
|
if chat_completion_response.evaluate_response is not None:
|
|
63
64
|
self.evaluate_response = EvaluateResponse(evaluation_request=EvaluateRequest())
|
|
65
|
+
if chat_completion_response.chat_completion_request is not None:
|
|
66
|
+
self.chat_completion_request = ChatCompletionRequest()
|
|
64
67
|
self.from_pydict(chat_completion_response.to_pydict())
|
|
65
68
|
|
|
66
69
|
def model_dump_json(self):
|
|
67
|
-
return self.to_pydict(casing=Casing.SNAKE)
|
|
70
|
+
return json.dumps(self.to_pydict(casing=Casing.SNAKE))
|
|
68
71
|
|
|
69
72
|
def openai_dump_json(self):
|
|
70
73
|
data = self.to_pydict(casing=Casing.SNAKE)
|
{maitai_python-1.0.38b0 → maitai_python-1.0.39}/maitai_common/processes/websocket_listener_thread.py
RENAMED
|
@@ -41,7 +41,7 @@ class WebsocketListenerThread(IOThread):
|
|
|
41
41
|
print(f'Received message: {message}')
|
|
42
42
|
self.messages.append(message)
|
|
43
43
|
|
|
44
|
-
def on_close(self, ws):
|
|
44
|
+
def on_close(self, ws, _, __):
|
|
45
45
|
print("WebSocket connection closed. Reconnecting...")
|
|
46
46
|
self.connect_to_websocket()
|
|
47
47
|
|
|
@@ -70,6 +70,19 @@ class ChatCompletionRequest(betterproto.Message):
|
|
|
70
70
|
return_request: bool = betterproto.bool_field(20)
|
|
71
71
|
fallback_model: str = betterproto.string_field(21)
|
|
72
72
|
user_id: str = betterproto.string_field(22)
|
|
73
|
+
assistant: bool = betterproto.bool_field(23)
|
|
74
|
+
client_params: "ClientParams" = betterproto.message_field(24)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@dataclass(eq=False, repr=False)
|
|
78
|
+
class ClientParams(betterproto.Message):
|
|
79
|
+
base_url: str = betterproto.string_field(1)
|
|
80
|
+
default_headers: Dict[str, str] = betterproto.map_field(
|
|
81
|
+
2, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
82
|
+
)
|
|
83
|
+
default_query: Dict[str, str] = betterproto.map_field(
|
|
84
|
+
3, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
85
|
+
)
|
|
73
86
|
|
|
74
87
|
|
|
75
88
|
@dataclass(eq=False, repr=False)
|
|
@@ -336,6 +349,19 @@ class Turn(betterproto.Message):
|
|
|
336
349
|
eval_request: "EvaluateRequest" = betterproto.message_field(3)
|
|
337
350
|
|
|
338
351
|
|
|
352
|
+
@dataclass(eq=False, repr=False)
|
|
353
|
+
class SessionMessage(betterproto.Message):
|
|
354
|
+
id: int = betterproto.int64_field(1)
|
|
355
|
+
application_id: int = betterproto.int64_field(2)
|
|
356
|
+
application_action_id: int = betterproto.int64_field(3)
|
|
357
|
+
session_id: str = betterproto.string_field(4)
|
|
358
|
+
request_id: str = betterproto.string_field(5)
|
|
359
|
+
role: str = betterproto.string_field(6)
|
|
360
|
+
content: str = betterproto.string_field(7)
|
|
361
|
+
instructions: str = betterproto.string_field(8)
|
|
362
|
+
date_created: int = betterproto.int64_field(9)
|
|
363
|
+
|
|
364
|
+
|
|
339
365
|
class EvaluationServiceStub(betterproto.ServiceStub):
|
|
340
366
|
async def evaluate(
|
|
341
367
|
self,
|
|
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
|
|
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
|