athena-intelligence 0.1.15__tar.gz → 0.1.17__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.
Files changed (29) hide show
  1. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/PKG-INFO +32 -3
  2. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/README.md +31 -2
  3. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/pyproject.toml +1 -1
  4. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/client_wrapper.py +1 -1
  5. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/polling_message_client.py +5 -8
  6. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/model.py +4 -0
  7. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/__init__.py +0 -0
  8. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/client.py +0 -0
  9. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/__init__.py +0 -0
  10. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/api_error.py +0 -0
  11. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/datetime_utils.py +0 -0
  12. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/file.py +0 -0
  13. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/jsonable_encoder.py +0 -0
  14. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/remove_none_from_dict.py +0 -0
  15. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/core/request_options.py +0 -0
  16. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/environment.py +0 -0
  17. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/errors/__init__.py +0 -0
  18. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/errors/unprocessable_entity_error.py +0 -0
  19. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/message/__init__.py +0 -0
  20. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/message/client.py +0 -0
  21. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/py.typed +0 -0
  22. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/__init__.py +0 -0
  23. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/http_validation_error.py +0 -0
  24. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/message_out.py +0 -0
  25. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/message_out_dto.py +0 -0
  26. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/status_enum.py +0 -0
  27. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/tools.py +0 -0
  28. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/validation_error.py +0 -0
  29. {athena_intelligence-0.1.15 → athena_intelligence-0.1.17}/src/athena/types/validation_error_loc_item.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: athena-intelligence
3
- Version: 0.1.15
3
+ Version: 0.1.17
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -39,11 +39,16 @@ Simply import `Athena` and start making calls to our API.
39
39
 
40
40
  ```python
41
41
  from athena.client import Athena
42
+ from athena import Model, Tools
42
43
 
43
44
  client = Athena(
44
45
  api_key="YOUR_API_KEY" # Defaults to ATHENA_API_KEY
45
46
  )
46
- message = client.messages.get("message_id")
47
+ message = client.message.submit(
48
+ content="visit www.athenaintelligence.ai and summarize the website in one paragraph",
49
+ model=Model.GPT_3_5_TURBO,
50
+ tools=[Tools.SEARCH, Tools.BROWSE, Tools.SEARCH],
51
+ )
47
52
  ```
48
53
 
49
54
  ## Async Client
@@ -52,18 +57,42 @@ calls to our API.
52
57
 
53
58
  ```python
54
59
  from athena.client import AsyncAthena
60
+ from athena import Model, Tools
55
61
 
56
62
  client = AsyncAthena(
57
63
  api_key="YOUR_API_KEY" # Defaults to ATHENA_API_KEY
58
64
  )
59
65
 
60
66
  async def main() -> None:
61
- message = client.messages.get("message_id")
67
+ message = client.message.submit(
68
+ content="visit www.athenaintelligence.ai and summarize the website in one paragraph",
69
+ model=Model.GPT_3_5_TURBO,
70
+ tools=[Tools.SEARCH, Tools.BROWSE, Tools.SEARCH],
71
+ )
62
72
  print("Received message", message)
63
73
 
64
74
  asyncio.run(main())
65
75
  ```
66
76
 
77
+ ## Polling
78
+ The SDK provides helper functions that will automatically poll when
79
+ retrieving a message. Use the `submit_and_poll` method as shown below:
80
+
81
+ ```python
82
+ from athena.client import Athena
83
+ from athena import Model, Tools
84
+
85
+ client = Athena(api_key="...")
86
+ message = client.message.submit_and_poll(
87
+ content="visit www.athenaintelligence.ai and summarize the website in one paragraph",
88
+ model=Model.GPT_3_5_TURBO,
89
+ tools=[Tools.SEARCH, Tools.BROWSE, Tools.SEARCH],
90
+ )
91
+ ```
92
+
93
+ By default, the method will poll every 2 seconds but you can override
94
+ this with the `poll_interval` argument.
95
+
67
96
  ## Athena Module
68
97
  All of the models are nested within the Athena module. Let IntelliSense
69
98
  guide you!
@@ -24,11 +24,16 @@ Simply import `Athena` and start making calls to our API.
24
24
 
25
25
  ```python
26
26
  from athena.client import Athena
27
+ from athena import Model, Tools
27
28
 
28
29
  client = Athena(
29
30
  api_key="YOUR_API_KEY" # Defaults to ATHENA_API_KEY
30
31
  )
31
- message = client.messages.get("message_id")
32
+ message = client.message.submit(
33
+ content="visit www.athenaintelligence.ai and summarize the website in one paragraph",
34
+ model=Model.GPT_3_5_TURBO,
35
+ tools=[Tools.SEARCH, Tools.BROWSE, Tools.SEARCH],
36
+ )
32
37
  ```
33
38
 
34
39
  ## Async Client
@@ -37,18 +42,42 @@ calls to our API.
37
42
 
38
43
  ```python
39
44
  from athena.client import AsyncAthena
45
+ from athena import Model, Tools
40
46
 
41
47
  client = AsyncAthena(
42
48
  api_key="YOUR_API_KEY" # Defaults to ATHENA_API_KEY
43
49
  )
44
50
 
45
51
  async def main() -> None:
46
- message = client.messages.get("message_id")
52
+ message = client.message.submit(
53
+ content="visit www.athenaintelligence.ai and summarize the website in one paragraph",
54
+ model=Model.GPT_3_5_TURBO,
55
+ tools=[Tools.SEARCH, Tools.BROWSE, Tools.SEARCH],
56
+ )
47
57
  print("Received message", message)
48
58
 
49
59
  asyncio.run(main())
50
60
  ```
51
61
 
62
+ ## Polling
63
+ The SDK provides helper functions that will automatically poll when
64
+ retrieving a message. Use the `submit_and_poll` method as shown below:
65
+
66
+ ```python
67
+ from athena.client import Athena
68
+ from athena import Model, Tools
69
+
70
+ client = Athena(api_key="...")
71
+ message = client.message.submit_and_poll(
72
+ content="visit www.athenaintelligence.ai and summarize the website in one paragraph",
73
+ model=Model.GPT_3_5_TURBO,
74
+ tools=[Tools.SEARCH, Tools.BROWSE, Tools.SEARCH],
75
+ )
76
+ ```
77
+
78
+ By default, the method will poll every 2 seconds but you can override
79
+ this with the `poll_interval` argument.
80
+
52
81
  ## Athena Module
53
82
  All of the models are nested within the Athena module. Let IntelliSense
54
83
  guide you!
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "athena-intelligence"
3
- version = "0.1.15"
3
+ version = "0.1.17"
4
4
  description = ""
5
5
  readme = "README.md"
6
6
  authors = []
@@ -14,7 +14,7 @@ class BaseClientWrapper:
14
14
  headers: typing.Dict[str, str] = {
15
15
  "X-Fern-Language": "Python",
16
16
  "X-Fern-SDK-Name": "athena-intelligence",
17
- "X-Fern-SDK-Version": "0.1.15",
17
+ "X-Fern-SDK-Version": "0.1.17",
18
18
  }
19
19
  headers["X-API-KEY"] = self.api_key
20
20
  return headers
@@ -17,7 +17,7 @@ OMIT = typing.cast(typing.Any, ...)
17
17
 
18
18
  class MessagePollingClient(MessageClient):
19
19
 
20
- def submit( # type: ignore
20
+ def submit_and_poll(
21
21
  self,
22
22
  *,
23
23
  content: str,
@@ -49,7 +49,6 @@ class MessagePollingClient(MessageClient):
49
49
 
50
50
  client = Athena(
51
51
  api_key="YOUR_API_KEY",
52
- token="YOUR_TOKEN",
53
52
  )
54
53
  client.message.submit(
55
54
  content="visit www.athenaintelligence.ai and summarize the website in one paragraph",
@@ -65,8 +64,7 @@ class MessagePollingClient(MessageClient):
65
64
  conversation_name=conversation_name,
66
65
  request_options=request_options)
67
66
  message = self.get(id=response.id)
68
- while message.status != StatusEnum.RESPONDED \
69
- or message.status != StatusEnum.ERROR:
67
+ while message.status == StatusEnum.PENDING:
70
68
  time.sleep(poll_interval)
71
69
  message = self.get(id=message.id)
72
70
  return message
@@ -74,7 +72,7 @@ class MessagePollingClient(MessageClient):
74
72
 
75
73
  class AsyncMessagePollingClient(AsyncMessageClient):
76
74
 
77
- async def submit( # type: ignore
75
+ async def submit_and_poll(
78
76
  self,
79
77
  *,
80
78
  content: str,
@@ -121,8 +119,7 @@ class AsyncMessagePollingClient(AsyncMessageClient):
121
119
  conversation_name=conversation_name,
122
120
  request_options=request_options)
123
121
  message = await self.get(id=response.id)
124
- while message.status != StatusEnum.RESPONDED \
125
- or message.status != StatusEnum.ERROR:
122
+ while message.status == StatusEnum.PENDING:
126
123
  time.sleep(poll_interval)
127
124
  message = await self.get(id=message.id)
128
- return message
125
+ return message
@@ -14,12 +14,14 @@ class Model(str, enum.Enum):
14
14
  GPT_35_TURBO = "gpt-3.5-turbo"
15
15
  GPT_4_TURBO_PREVIEW = "gpt-4-turbo-preview"
16
16
  MIXTRAL_SMALL_8_X_7_B_0211 = "mixtral-small-8x7b-0211"
17
+ MISTRAL_LARGE_0224 = "mistral-large-0224"
17
18
 
18
19
  def visit(
19
20
  self,
20
21
  gpt_35_turbo: typing.Callable[[], T_Result],
21
22
  gpt_4_turbo_preview: typing.Callable[[], T_Result],
22
23
  mixtral_small_8_x_7_b_0211: typing.Callable[[], T_Result],
24
+ mistral_large_0224: typing.Callable[[], T_Result],
23
25
  ) -> T_Result:
24
26
  if self is Model.GPT_35_TURBO:
25
27
  return gpt_35_turbo()
@@ -27,3 +29,5 @@ class Model(str, enum.Enum):
27
29
  return gpt_4_turbo_preview()
28
30
  if self is Model.MIXTRAL_SMALL_8_X_7_B_0211:
29
31
  return mixtral_small_8_x_7_b_0211()
32
+ if self is Model.MISTRAL_LARGE_0224:
33
+ return mistral_large_0224()