maitai-python 1.1.27__tar.gz → 1.1.28__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.27 → maitai_python-1.1.28}/PKG-INFO +1 -1
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_maitai.py +16 -1
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_maitai_async.py +16 -1
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/version.py +1 -1
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.1.27 → maitai_python-1.1.28}/README.md +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_azure.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_config.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_context.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_evaluator.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_inference.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_types.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/_utils.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai/tools/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/utils/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/utils/proto_utils.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_common/utils/types.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/annotation/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/backtest/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/billing/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/chat/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/embedding/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/event/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/metric/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/model/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/rates/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/sentinel/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/setup.cfg +0 -0
- {maitai_python-1.1.27 → maitai_python-1.1.28}/setup.py +0 -0
|
@@ -328,7 +328,15 @@ class Completions:
|
|
|
328
328
|
retry_args["model"] = model
|
|
329
329
|
retry_args["fallback_model"] = fallback_model
|
|
330
330
|
return _process_inference_stream(
|
|
331
|
-
response,
|
|
331
|
+
response,
|
|
332
|
+
retry_args,
|
|
333
|
+
self.create,
|
|
334
|
+
timing,
|
|
335
|
+
includes_usage=(
|
|
336
|
+
stream_options.get("include_usage", False)
|
|
337
|
+
if stream_options and stream_options != openai.NOT_GIVEN
|
|
338
|
+
else False
|
|
339
|
+
),
|
|
332
340
|
)
|
|
333
341
|
# ChatCompletion only
|
|
334
342
|
for resp in response:
|
|
@@ -503,6 +511,7 @@ def _process_inference_stream(
|
|
|
503
511
|
retry_args: dict,
|
|
504
512
|
retry_func,
|
|
505
513
|
timing: RequestTimingMetric,
|
|
514
|
+
includes_usage: bool = False,
|
|
506
515
|
) -> Iterable[MaitaiChunk]:
|
|
507
516
|
first = True
|
|
508
517
|
try:
|
|
@@ -523,6 +532,12 @@ def _process_inference_stream(
|
|
|
523
532
|
maitai.Inference.store_request_timing_data(timing)
|
|
524
533
|
if chunk.usage:
|
|
525
534
|
return
|
|
535
|
+
if (
|
|
536
|
+
not includes_usage
|
|
537
|
+
and chunk.choices
|
|
538
|
+
and chunk.choices[0].finish_reason
|
|
539
|
+
):
|
|
540
|
+
return
|
|
526
541
|
except MaitaiConnectionError as e:
|
|
527
542
|
if "gpt" not in retry_args.get("model", "") and "gpt" in retry_args.get(
|
|
528
543
|
"fallback_model", ""
|
|
@@ -325,7 +325,15 @@ class AsyncCompletions:
|
|
|
325
325
|
retry_args["model"] = model
|
|
326
326
|
retry_args["fallback_model"] = fallback_model
|
|
327
327
|
return _process_inference_stream_async(
|
|
328
|
-
response,
|
|
328
|
+
response,
|
|
329
|
+
retry_args,
|
|
330
|
+
self.create,
|
|
331
|
+
timing,
|
|
332
|
+
includes_usage=(
|
|
333
|
+
stream_options.get("include_usage", False)
|
|
334
|
+
if stream_options and stream_options != openai.NOT_GIVEN
|
|
335
|
+
else False
|
|
336
|
+
),
|
|
329
337
|
)
|
|
330
338
|
# ChatCompletion only
|
|
331
339
|
async for resp in response:
|
|
@@ -502,6 +510,7 @@ async def _process_inference_stream_async(
|
|
|
502
510
|
retry_args: dict,
|
|
503
511
|
retry_func,
|
|
504
512
|
timing: RequestTimingMetric,
|
|
513
|
+
includes_usage: bool = False,
|
|
505
514
|
) -> AsyncIterable[MaitaiChunk]:
|
|
506
515
|
first = True
|
|
507
516
|
try:
|
|
@@ -522,6 +531,12 @@ async def _process_inference_stream_async(
|
|
|
522
531
|
maitai.Inference.store_request_timing_data(timing)
|
|
523
532
|
if chunk.usage:
|
|
524
533
|
return
|
|
534
|
+
if (
|
|
535
|
+
not includes_usage
|
|
536
|
+
and chunk.choices
|
|
537
|
+
and chunk.choices[0].finish_reason
|
|
538
|
+
):
|
|
539
|
+
return
|
|
525
540
|
except MaitaiConnectionError as e:
|
|
526
541
|
if "gpt" not in retry_args.get("model", "") and "gpt" in retry_args.get(
|
|
527
542
|
"fallback_model", ""
|
|
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.27 → maitai_python-1.1.28}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|