maitai-python 1.0.8__py3-none-any.whl → 1.0.9__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.
maitai/__init__.py CHANGED
@@ -3,10 +3,10 @@ import os
3
3
  from maitai._azure import MaitaiAsyncAzureOpenAIClient as AsyncAzureOpenAI, MaitaiAzureOpenAIClient as AzureOpenAI
4
4
  from maitai._evaluator import Evaluator as Evaluator
5
5
  from maitai._inference import Inference as Inference
6
- from maitai._openai import MaitaiOpenAIClient as OpenAI
6
+ from maitai._openai import Chat, MaitaiOpenAIClient as OpenAI
7
7
  from maitai._openai_async import MaitaiAsyncOpenAIClient as AsyncOpenAI
8
8
 
9
- chat = OpenAI().chat
9
+ chat = Chat()
10
10
 
11
11
 
12
12
  def initialize(api_key):
maitai/_openai.py CHANGED
@@ -59,8 +59,6 @@ class Chat:
59
59
 
60
60
  class Completions:
61
61
  def __init__(self, client: Optional[openai.Client] = None):
62
- if client is None:
63
- client = openai.OpenAI()
64
62
  self.client = client
65
63
 
66
64
  @required_args(["session_id", "action_type", "application_ref_name", "messages"],
@@ -111,6 +109,8 @@ class Completions:
111
109
  raise ValueError("server_side_inference must be true to apply_corrections")
112
110
  if apply_corrections is True and evaluation_enabled is False:
113
111
  raise ValueError("evaluations must be enabled to apply_corrections")
112
+ if self.client is None:
113
+ self.client = openai.OpenAI()
114
114
  maitai_config = config.get_application_action_config(application_ref_name, action_type)
115
115
  if server_side_inference is None:
116
116
  server_side_inference = maitai_config.inference_location == InferenceLocations.SERVER
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maitai-python
3
- Version: 1.0.8
3
+ Version: 1.0.9
4
4
  Summary: Maitai SDK for Python
5
5
  Home-page: https://docs.trymaitai.ai
6
6
  Author: Maitai
@@ -14,7 +14,7 @@ Requires-Dist: openai
14
14
  Requires-Dist: betterproto
15
15
  Requires-Dist: httpx
16
16
  Requires-Dist: aiohttp
17
- Requires-Dist: setuptools
17
+ Requires-Dist: betterproto ==2.0.0b6
18
18
  Requires-Dist: websocket-client
19
19
 
20
20
  # Quickstart
@@ -1,11 +1,11 @@
1
- maitai/__init__.py,sha256=fomeUm8OO6yxeD7nN8ocOamoMjO1L_dm7Jg4vecHRkc,616
1
+ maitai/__init__.py,sha256=bJA4HK9W6_mLk7K81aVbREhf_GXbWMl5jX4QJshcBBA,615
2
2
  maitai/_azure.py,sha256=ZsaUSZ8JJyyh8axhexuEGWZ7_-QBaUgS8FT8l6gJ9WU,8561
3
3
  maitai/_config.py,sha256=y5c1XooRsbcFXK1JD3JQqu7hNKcs1B8P5m_JkAGbjbU,3234
4
4
  maitai/_config_listener_thread.py,sha256=Wg8dh5K8ubmZMZJ3RWdtenGCFnhR0B5gzpqhhnMy6kM,495
5
5
  maitai/_evaluator.py,sha256=7upvPIWU8DWIykPhuRRw6aiQerFN6UfJmC5UjiBi2IY,7845
6
6
  maitai/_inference.py,sha256=Y_oIpP_Rtiu7h9_Vw0Ih7hQMAa-LcNe3iCGNCbU1e6g,7278
7
7
  maitai/_maitai_client.py,sha256=KeaNcIWdXC5yAqsEo6QRCxCUqzbNDvcUmDO85B2Nm6g,1887
8
- maitai/_openai.py,sha256=O_ossnkx149zkUI53-g2hXIBW1sCIyd7dO1OCEG1aP0,13427
8
+ maitai/_openai.py,sha256=MOtBMjBpBThV0xvMnCUZgag--SxS6z42Tkyw09oBoqM,13437
9
9
  maitai/_openai_async.py,sha256=a31Kn9G5XbFF-Azo_h3mw9AP9rwBi6rsFKQppSiv7Z0,13588
10
10
  maitai/_openai_types.py,sha256=8OrDnYca0PSU4ICYeB0DGkVIV-sAh89_zRcJPu8h_i0,236
11
11
  maitai/_utils.py,sha256=QUn4Ga4SgtHm573A1MXiwb9XijSpq2RBK7I9PqAaJzs,8191
@@ -28,7 +28,7 @@ maitai_gen/notification/__init__.py,sha256=2WaCP-EwmiPDkneJyGJnB1fpgriukmjHH2ZPg
28
28
  maitai_gen/sandbox/__init__.py,sha256=enYj1gknTYnJtFAHnrsPjwKnJgFSCqsmn5cdECVqNRI,1610
29
29
  maitai_gen/sentinel/__init__.py,sha256=1aTuX3iyrye_T_xbI3iSCaJKaS5mWcmylVOMVcb7biI,1613
30
30
  maitai_gen/session/__init__.py,sha256=-P9hLbZ4PzeQZxuHvQegCAAntDq8mYw3uJf7uYBxvuA,1286
31
- maitai_python-1.0.8.dist-info/METADATA,sha256=lxTEjujtzgKOaw1ALR-ETeYTMzRDHvq9K89vmQ3azkY,1719
32
- maitai_python-1.0.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
33
- maitai_python-1.0.8.dist-info/top_level.txt,sha256=-5U1krxnwlqB-AY7nEe29ZcNvwByNc-SnBe-mph-QjI,32
34
- maitai_python-1.0.8.dist-info/RECORD,,
31
+ maitai_python-1.0.9.dist-info/METADATA,sha256=WmyYnVPG8MKw2QYKwRRD-qkGSDdULDMEHsBJCJGRCA8,1730
32
+ maitai_python-1.0.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
33
+ maitai_python-1.0.9.dist-info/top_level.txt,sha256=-5U1krxnwlqB-AY7nEe29ZcNvwByNc-SnBe-mph-QjI,32
34
+ maitai_python-1.0.9.dist-info/RECORD,,