exa-py 1.0.10__py3-none-any.whl → 1.0.12__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.
Potentially problematic release.
This version of exa-py might be problematic. Click here for more details.
exa_py/api.py
CHANGED
|
@@ -20,17 +20,8 @@ from typing_extensions import TypedDict
|
|
|
20
20
|
|
|
21
21
|
import httpx
|
|
22
22
|
from openai import NOT_GIVEN, NotGiven, OpenAI
|
|
23
|
-
from openai.types.chat.chat_completion_stream_options_param import (
|
|
24
|
-
ChatCompletionStreamOptionsParam,
|
|
25
|
-
)
|
|
26
23
|
from openai.types.chat.chat_completion_message_param import ChatCompletionMessageParam
|
|
27
24
|
from openai.types.chat_model import ChatModel
|
|
28
|
-
from openai.types.chat.chat_completion_tool_choice_option_param import (
|
|
29
|
-
ChatCompletionToolChoiceOptionParam,
|
|
30
|
-
)
|
|
31
|
-
from openai.types.chat.chat_completion_tool_param import ChatCompletionToolParam
|
|
32
|
-
from openai._types import Headers, Query, Body
|
|
33
|
-
from openai.types.chat import completion_create_params
|
|
34
25
|
from exa_py.utils import (
|
|
35
26
|
ExaOpenAICompletion,
|
|
36
27
|
add_message_to_messages,
|
|
@@ -344,7 +335,7 @@ class Exa:
|
|
|
344
335
|
self,
|
|
345
336
|
api_key: Optional[str],
|
|
346
337
|
base_url: str = "https://api.exa.ai",
|
|
347
|
-
user_agent: str = "exa-py 1.0.
|
|
338
|
+
user_agent: str = "exa-py 1.0.12",
|
|
348
339
|
):
|
|
349
340
|
"""Initialize the Exa client with the provided API key and optional base URL and user agent.
|
|
350
341
|
|
|
@@ -692,38 +683,6 @@ class Exa:
|
|
|
692
683
|
# Mandatory OpenAI args
|
|
693
684
|
messages: Iterable[ChatCompletionMessageParam],
|
|
694
685
|
model: Union[str, ChatModel],
|
|
695
|
-
# Optional OpenAI args
|
|
696
|
-
frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN,
|
|
697
|
-
function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN,
|
|
698
|
-
functions: (
|
|
699
|
-
Iterable[completion_create_params.Function] | NotGiven
|
|
700
|
-
) = NOT_GIVEN,
|
|
701
|
-
logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN,
|
|
702
|
-
logprobs: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
703
|
-
max_tokens: Optional[int] | NotGiven = NOT_GIVEN,
|
|
704
|
-
n: Optional[int] | NotGiven = NOT_GIVEN,
|
|
705
|
-
presence_penalty: Optional[float] | NotGiven = NOT_GIVEN,
|
|
706
|
-
response_format: (
|
|
707
|
-
completion_create_params.ResponseFormat | NotGiven
|
|
708
|
-
) = NOT_GIVEN,
|
|
709
|
-
seed: Optional[int] | NotGiven = NOT_GIVEN,
|
|
710
|
-
stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
|
711
|
-
stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN,
|
|
712
|
-
stream_options: (
|
|
713
|
-
Optional[ChatCompletionStreamOptionsParam] | NotGiven
|
|
714
|
-
) = NOT_GIVEN,
|
|
715
|
-
temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
|
716
|
-
tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
|
717
|
-
tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
|
718
|
-
top_logprobs: Optional[int] | NotGiven = NOT_GIVEN,
|
|
719
|
-
top_p: Optional[float] | NotGiven = NOT_GIVEN,
|
|
720
|
-
user: str | NotGiven = NOT_GIVEN,
|
|
721
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
722
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
723
|
-
extra_headers: Headers | None = None,
|
|
724
|
-
extra_query: Query | None = None,
|
|
725
|
-
extra_body: Body | None = None,
|
|
726
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
727
686
|
# Exa args
|
|
728
687
|
use_exa: Optional[Literal["required", "none", "auto"]] = "auto",
|
|
729
688
|
highlights: Union[HighlightsContentsOptions, Literal[True], None] = None,
|
|
@@ -738,6 +697,8 @@ class Exa:
|
|
|
738
697
|
type: Optional[str] = None,
|
|
739
698
|
category: Optional[str] = None,
|
|
740
699
|
result_max_len: int = 2048,
|
|
700
|
+
# OpenAI args
|
|
701
|
+
**openai_kwargs,
|
|
741
702
|
):
|
|
742
703
|
exa_kwargs = {
|
|
743
704
|
"num_results": num_results,
|
|
@@ -755,33 +716,11 @@ class Exa:
|
|
|
755
716
|
|
|
756
717
|
create_kwargs = {
|
|
757
718
|
"model": model,
|
|
758
|
-
|
|
759
|
-
"function_call": function_call,
|
|
760
|
-
"functions": functions,
|
|
761
|
-
"logit_bias": logit_bias,
|
|
762
|
-
"logprobs": logprobs,
|
|
763
|
-
"max_tokens": max_tokens,
|
|
764
|
-
"n": n,
|
|
765
|
-
"presence_penalty": presence_penalty,
|
|
766
|
-
"response_format": response_format,
|
|
767
|
-
"seed": seed,
|
|
768
|
-
"stop": stop,
|
|
769
|
-
"stream": stream,
|
|
770
|
-
"stream_options": stream_options,
|
|
771
|
-
"temperature": temperature,
|
|
772
|
-
"tool_choice": tool_choice,
|
|
773
|
-
"tools": tools,
|
|
774
|
-
"top_logprobs": top_logprobs,
|
|
775
|
-
"top_p": top_p,
|
|
776
|
-
"user": user,
|
|
777
|
-
"extra_headers": extra_headers,
|
|
778
|
-
"extra_query": extra_query,
|
|
779
|
-
"extra_body": extra_body,
|
|
780
|
-
"timeout": timeout,
|
|
719
|
+
**openai_kwargs,
|
|
781
720
|
}
|
|
782
721
|
|
|
783
722
|
if use_exa != "none":
|
|
784
|
-
assert tools
|
|
723
|
+
assert "tools" not in create_kwargs, "Tool use is not supported with Exa"
|
|
785
724
|
create_kwargs["tool_choice"] = use_exa
|
|
786
725
|
|
|
787
726
|
return self._create_with_tool(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: exa-py
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.12
|
|
4
4
|
Summary: Python SDK for Exa API.
|
|
5
5
|
Home-page: https://github.com/exa-labs/exa-py
|
|
6
6
|
Author: Exa
|
|
@@ -19,8 +19,6 @@ Description-Content-Type: text/markdown
|
|
|
19
19
|
Requires-Dist: requests
|
|
20
20
|
Requires-Dist: typing-extensions
|
|
21
21
|
Requires-Dist: openai
|
|
22
|
-
Provides-Extra: openai
|
|
23
|
-
Requires-Dist: openai ; extra == 'openai'
|
|
24
22
|
|
|
25
23
|
# Exa
|
|
26
24
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
exa_py/__init__.py,sha256=aVF1zB_UV3dagJ5Vn2WrdcInzibdIW61M89sjwRCU_g,29
|
|
2
|
+
exa_py/api.py,sha256=fmPCOzC31meRaBYt2V3skZZDg2xiQaWt60G1Zs5DIHY,27839
|
|
3
|
+
exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
exa_py/utils.py,sha256=pF91TKGGg4SbSVrdWroQze90-D9AlvqLoKWlHIeyLaE,2402
|
|
5
|
+
exa_py-1.0.12.dist-info/METADATA,sha256=rUIwnAb5tx5U4e9ue8QguSsEZhriJNIJNWxTVEVkSM0,3072
|
|
6
|
+
exa_py-1.0.12.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
7
|
+
exa_py-1.0.12.dist-info/top_level.txt,sha256=Mfkmscdw9HWR1PtVhU1gAiVo6DHu_tyiVdb89gfZBVI,7
|
|
8
|
+
exa_py-1.0.12.dist-info/RECORD,,
|
exa_py-1.0.10.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
exa_py/__init__.py,sha256=aVF1zB_UV3dagJ5Vn2WrdcInzibdIW61M89sjwRCU_g,29
|
|
2
|
-
exa_py/api.py,sha256=FdGJG46Ix8TvStF-mmuJ-QMtXzvqPRQcLnOogHj24Uc,31032
|
|
3
|
-
exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
exa_py/utils.py,sha256=pF91TKGGg4SbSVrdWroQze90-D9AlvqLoKWlHIeyLaE,2402
|
|
5
|
-
exa_py-1.0.10.dist-info/METADATA,sha256=NOvPj8ZfTUiMFVXufUSXz5EySt2zmYhBfnXsaBqdvj4,3137
|
|
6
|
-
exa_py-1.0.10.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
7
|
-
exa_py-1.0.10.dist-info/top_level.txt,sha256=Mfkmscdw9HWR1PtVhU1gAiVo6DHu_tyiVdb89gfZBVI,7
|
|
8
|
-
exa_py-1.0.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|