maitai-python 1.1.46__py3-none-any.whl → 1.2.1__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
@@ -1,9 +1,6 @@
1
1
  import os
2
2
 
3
- from maitai._azure import (
4
- MaitaiAsyncAzureOpenAIClient as AsyncAzureOpenAI,
5
- MaitaiAzureOpenAIClient as AzureOpenAI,
6
- )
3
+ from maitai._azure import MaitaiAsyncAzureOpenAIClient, MaitaiAzureOpenAIClient
7
4
  from maitai._context import ContextManager
8
5
  from maitai._evaluator import Evaluator as Evaluator
9
6
  from maitai._inference import Inference as Inference
@@ -15,12 +12,11 @@ context = ContextManager()
15
12
  AsyncOpenAI = MaitaiAsync
16
13
  OpenAI = Maitai
17
14
 
15
+ AsyncAzureOpenAI = MaitaiAsyncAzureOpenAIClient
16
+ AzureOpenAI = MaitaiAzureOpenAIClient
17
+
18
18
 
19
19
  def initialize(api_key):
20
20
  from maitai._config import config
21
21
 
22
22
  config.initialize(api_key)
23
-
24
-
25
- if os.environ.get("MAITAI_API_KEY") and os.environ.get("MAITAI_ENV") != "development":
26
- initialize(os.environ.get("MAITAI_API_KEY"))
maitai/_maitai.py CHANGED
@@ -66,6 +66,10 @@ class Maitai:
66
66
  maitai_api_key = os.environ.get("MAITAI_API_KEY")
67
67
  if maitai_api_key:
68
68
  config.initialize(maitai_api_key)
69
+ else:
70
+ raise ValueError(
71
+ "MAITAI_API_KEY has not been set. Either set via environment variable or pass it directly into the client."
72
+ )
69
73
  if api_key:
70
74
  if not openai_api_key:
71
75
  openai_api_key = api_key
@@ -256,7 +260,7 @@ class Completions:
256
260
  max_tokens = maitai_config.max_tokens
257
261
  if max_completion_tokens and max_completion_tokens != openai.NOT_GIVEN:
258
262
  max_tokens = max_completion_tokens
259
- if n == openai.NOT_GIVEN:
263
+ if n == openai.NOT_GIVEN and maitai_config.n:
260
264
  n = maitai_config.n
261
265
  if frequency_penalty == openai.NOT_GIVEN:
262
266
  frequency_penalty = maitai_config.frequency_penalty
maitai/_maitai_async.py CHANGED
@@ -62,8 +62,15 @@ class MaitaiAsync:
62
62
  http_client: Optional[httpx.Client] = None,
63
63
  _strict_response_validation: bool = False,
64
64
  ):
65
+ if not maitai_api_key:
66
+ maitai_api_key = os.environ.get("MAITAI_API_KEY")
65
67
  if maitai_api_key:
66
68
  config.initialize(maitai_api_key)
69
+ else:
70
+ raise ValueError(
71
+ "MAITAI_API_KEY has not been set. Either set via environment variable or pass it directly into the client."
72
+ )
73
+
67
74
  if api_key:
68
75
  if not openai_api_key:
69
76
  openai_api_key = api_key
@@ -254,7 +261,7 @@ class AsyncCompletions:
254
261
  max_tokens = maitai_config.max_tokens
255
262
  if max_completion_tokens and max_completion_tokens != openai.NOT_GIVEN:
256
263
  max_tokens = max_completion_tokens
257
- if n == openai.NOT_GIVEN:
264
+ if n == openai.NOT_GIVEN and maitai_config.n:
258
265
  n = maitai_config.n
259
266
  if frequency_penalty == openai.NOT_GIVEN:
260
267
  frequency_penalty = maitai_config.frequency_penalty
maitai_common/version.py CHANGED
@@ -1,3 +1,3 @@
1
- version = "1.1.46"
1
+ version = "1.2.1"
2
2
  if __name__ == "__main__":
3
3
  print(version)
@@ -36,3 +36,16 @@ class EvaluationRun(betterproto.Message):
36
36
  )
37
37
  request_count: int = betterproto.int64_field(13)
38
38
  requests: List["_chat__.EvaluateRequest"] = betterproto.message_field(14)
39
+
40
+
41
+ @dataclass(eq=False, repr=False)
42
+ class TestSet(betterproto.Message):
43
+ id: int = betterproto.int64_field(1)
44
+ name: str = betterproto.string_field(2)
45
+ company_id: int = betterproto.int64_field(3)
46
+ application_id: int = betterproto.int64_field(4)
47
+ application_action_id: int = betterproto.int64_field(5)
48
+ meta: Dict[str, str] = betterproto.map_field(
49
+ 6, betterproto.TYPE_STRING, betterproto.TYPE_STRING
50
+ )
51
+ date_created: int = betterproto.int64_field(7)
@@ -67,15 +67,20 @@ class ExportRequest(betterproto.Message):
67
67
  fourbit: bool = betterproto.bool_field(8)
68
68
  run_name: Optional[str] = betterproto.string_field(9, optional=True)
69
69
  base_model: str = betterproto.string_field(10)
70
+ display_name: str = betterproto.string_field(11)
70
71
 
71
72
 
72
73
  @dataclass(eq=False, repr=False)
73
74
  class FinetuneRequest(betterproto.Message):
74
- input_file: str = betterproto.string_field(1)
75
- run_name: str = betterproto.string_field(2)
76
- conversation_mode: bool = betterproto.bool_field(3)
77
- fourbit: bool = betterproto.bool_field(4)
78
- prompt: Optional[str] = betterproto.string_field(5, optional=True)
79
- max_steps: Optional[int] = betterproto.int32_field(6, optional=True)
80
- run_id: int = betterproto.int64_field(7)
81
- base_model: str = betterproto.string_field(8)
75
+ company_id: str = betterproto.string_field(1)
76
+ application_id: str = betterproto.string_field(2)
77
+ intent_id: str = betterproto.string_field(3)
78
+ input_file: str = betterproto.string_field(4)
79
+ run_name: str = betterproto.string_field(5)
80
+ conversation_mode: bool = betterproto.bool_field(6)
81
+ fourbit: bool = betterproto.bool_field(7)
82
+ prompt: Optional[str] = betterproto.string_field(8, optional=True)
83
+ max_steps: Optional[int] = betterproto.int32_field(9, optional=True)
84
+ run_id: int = betterproto.int64_field(10)
85
+ base_model: str = betterproto.string_field(11)
86
+ display_name: str = betterproto.string_field(12)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maitai-python
3
- Version: 1.1.46
3
+ Version: 1.2.1
4
4
  Summary: Maitai SDK for Python
5
5
  Home-page: https://docs.trymaitai.ai
6
6
  Author: Maitai
@@ -11,7 +11,6 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Description-Content-Type: text/markdown
12
12
  Requires-Dist: requests
13
13
  Requires-Dist: openai>=1.34.0
14
- Requires-Dist: betterproto
15
14
  Requires-Dist: httpx
16
15
  Requires-Dist: aiohttp
17
16
  Requires-Dist: betterproto==2.0.0b7
@@ -1,18 +1,18 @@
1
- maitai/__init__.py,sha256=gJACvMK7oAYud4SEZR5p79KIxRoG0r8GEOGpOtLH94U,692
1
+ maitai/__init__.py,sha256=HjnRas9JQpcCPOh9m1ABfexl6BV69tRcJzArdQpCWkQ,593
2
2
  maitai/_azure.py,sha256=ZQXVzmU2QPJ41wQUxqFkyeAKAJ6HrMoQKDbi3lyUJVc,8513
3
3
  maitai/_config.py,sha256=n1RV9Udg5_EGNLCvVm8WR_RAmNeI2LCXkIWDXme727I,10104
4
4
  maitai/_config_listener_thread.py,sha256=VaftjUXrP8oe6yg0TXUlIZW2vGw7bTk8p_95o4dSVgo,902
5
5
  maitai/_context.py,sha256=WmCLGd7BK1ViImd7uDTsjly7ECcugioZhGjxXwETHfI,2401
6
6
  maitai/_evaluator.py,sha256=qbwj--FCvNnRz-LTpuenMYf-2eGZRMrPqxepSerKWUo,10355
7
7
  maitai/_inference.py,sha256=uINtF7KUFGfLDZ4wQ8rI45czfl7qYU4GcrGVv0nFaEc,13624
8
- maitai/_maitai.py,sha256=ZZNuzYiUtV0GJEyPtxuReeimKW4i7sGTDHsgC0C5OPs,23386
9
- maitai/_maitai_async.py,sha256=J_5lKKIo03fhZHqY3nxmdvZ34R1cL63CpG-K5tELr_g,23432
8
+ maitai/_maitai.py,sha256=AWnwbLviZd2SLXR6fR_UABenJsKg5Gh6fwfVba8HO0w,23588
9
+ maitai/_maitai_async.py,sha256=8PZC3BFrNBg8gNjtufdDycybMzBGhUIXdVdQkAXhVO0,23728
10
10
  maitai/_maitai_client.py,sha256=NrICbHWhfx-u6pdXSUCjKRlPYmJO9nWb4hgnr3vf1y8,1981
11
11
  maitai/_types.py,sha256=JEF0kGlnAdT-GDF927FfpH85FTz2dmaFp1FJg04WOos,6273
12
12
  maitai/_utils.py,sha256=3JN5MClGZNkcmn-hWgi8fNV2n-Ytlek37H3S6TEHzuk,11276
13
13
  maitai/tools/__init__.py,sha256=TxJ-g4A0eIzoIMD60ctIPVppCWcdcuZWms3hPGrqkSs,4043
14
14
  maitai_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- maitai_common/version.py,sha256=U8yPGXFyNxhGCe21FY7Lbj2x76f6MI1xbf9pbO3SkNI,65
15
+ maitai_common/version.py,sha256=VPkIDQwPJjvm-Jr51LgdnqtVODDJ34WFe1Pwmxqo3rY,64
16
16
  maitai_common/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  maitai_common/config/config_service.py,sha256=U8hU0F9juZtrZwIayOM_OBShxynUS8gu5K0F40KvcA0,940
18
18
  maitai_common/processes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -27,9 +27,9 @@ maitai_gen/chat/__init__.py,sha256=ZHz3G8NLoKVyFkmsh-_wyCZ4eTJqSB6Pg6lw2jB693c,2
27
27
  maitai_gen/company/__init__.py,sha256=Jj03m8QlVsGLr0VQA-T5yxjbC1R3cx0gthUwgtbtGuc,739
28
28
  maitai_gen/config/__init__.py,sha256=vNW0hWIuYwDZNKwnPwSIYkwHmPIe5HA1IPfisQQ_Img,2008
29
29
  maitai_gen/embedding/__init__.py,sha256=py5vAEdXFatL7daub1YSnruIRV-im0heWSa5hjaSljM,941
30
- maitai_gen/evaluation/__init__.py,sha256=DhnQIFShgDSCIE7r7PUBsOBSlZu7h_06vMQBl20xDxY,1292
30
+ maitai_gen/evaluation/__init__.py,sha256=CjB_Vnokmfawg-wte9YLB-e4OR8A6QI1B1ftZc7Pe_A,1777
31
31
  maitai_gen/event/__init__.py,sha256=puOhfH-KQu_fL-yPJPjceDhwy3VbzP0oTtQs-RHeTE4,670
32
- maitai_gen/finetuning/__init__.py,sha256=BRbQDUSERvzPLxAxQN8HJDAsxnE9bRBaViTsoAAIdgo,3040
32
+ maitai_gen/finetuning/__init__.py,sha256=e0kdoBdKjXXgufokcEr5WOjEFuqRE1JUCj3FJ0SroHA,3301
33
33
  maitai_gen/inference/__init__.py,sha256=KUWiTng5KeibART4NZ91JuN6fR4u7hmxcx8BjhCde78,741
34
34
  maitai_gen/key/__init__.py,sha256=lDgA5vvqO0J_XmE8IxAWk640t0karVmi_6ThiMowttc,1338
35
35
  maitai_gen/metric/__init__.py,sha256=RX1sF74PB2L2lTD7EYfim5BSRmvGVd63L__IgJhZDh0,615
@@ -38,7 +38,7 @@ maitai_gen/rates/__init__.py,sha256=Aho7HzMKRfjQz10tMJCoRVttq_cGlYh2DxxpSyTQAzU,
38
38
  maitai_gen/sandbox/__init__.py,sha256=IZ4hf76V1aZrYk5S-4p7z38e-op_s341utVG2domE_g,1549
39
39
  maitai_gen/sentinel/__init__.py,sha256=3yR28usTBIAC-M_uxEUFgqXo2PWylEKEPYmWX_dp7Cs,2513
40
40
  maitai_gen/session/__init__.py,sha256=kCJweCFagUqGkzktucaWLti9HSLaO5AML8Jewl89yM0,1242
41
- maitai_python-1.1.46.dist-info/METADATA,sha256=aQgLQiP6N2ZGvxPwcNiahMxrtXRxKO_gvmIVx7TXHpQ,1522
42
- maitai_python-1.1.46.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
43
- maitai_python-1.1.46.dist-info/top_level.txt,sha256=-5U1krxnwlqB-AY7nEe29ZcNvwByNc-SnBe-mph-QjI,32
44
- maitai_python-1.1.46.dist-info/RECORD,,
41
+ maitai_python-1.2.1.dist-info/METADATA,sha256=Dd_xqvZboo7rlydtTiYqgFi_8pDcoXYxQgGxPrbtWIk,1494
42
+ maitai_python-1.2.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
43
+ maitai_python-1.2.1.dist-info/top_level.txt,sha256=-5U1krxnwlqB-AY7nEe29ZcNvwByNc-SnBe-mph-QjI,32
44
+ maitai_python-1.2.1.dist-info/RECORD,,