vectorvein 0.2.21__tar.gz → 0.2.22__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.
- {vectorvein-0.2.21 → vectorvein-0.2.22}/PKG-INFO +1 -1
- {vectorvein-0.2.21 → vectorvein-0.2.22}/pyproject.toml +1 -1
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/anthropic_client.py +4 -4
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/openai_compatible_client.py +2 -2
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/utils.py +7 -2
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/types/llm_parameters.py +15 -2
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/types/settings.py +17 -1
- {vectorvein-0.2.21 → vectorvein-0.2.22}/README.md +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/__init__.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/api/__init__.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/api/client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/api/exceptions.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/api/models.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/__init__.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/baichuan_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/base_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/deepseek_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/ernie_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/gemini_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/groq_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/local_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/minimax_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/mistral_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/moonshot_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/openai_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/py.typed +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/qwen_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/stepfun_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/xai_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/yi_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/zhipuai_client.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/py.typed +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/server/token_server.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/settings/__init__.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/settings/py.typed +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/types/__init__.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/types/defaults.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/types/enums.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/types/exception.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/types/py.typed +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/utilities/media_processing.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/utilities/rate_limiter.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/utilities/retry.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/graph/edge.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/graph/node.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/graph/port.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/graph/workflow.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/__init__.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/audio_generation.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/control_flows.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/file_processing.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/image_generation.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/llms.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/media_editing.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/media_processing.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/output.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/relational_db.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/text_processing.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/tools.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/triggers.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/vector_db.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/video_generation.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/nodes/web_crawlers.py +0 -0
- {vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/workflow/utils/json_to_code.py +0 -0
@@ -214,7 +214,7 @@ class AnthropicChatClient(BaseChatClient):
|
|
214
214
|
if self.endpoint.proxy is not None and self.http_client is None:
|
215
215
|
self.http_client = httpx.Client(proxy=self.endpoint.proxy)
|
216
216
|
|
217
|
-
if self.endpoint.is_vertex:
|
217
|
+
if self.endpoint.is_vertex or self.endpoint.endpoint_type == "anthropic_vertex":
|
218
218
|
if self.endpoint.credentials is None:
|
219
219
|
raise ValueError("Anthropic Vertex endpoint requires credentials")
|
220
220
|
self.creds = Credentials(
|
@@ -248,7 +248,7 @@ class AnthropicChatClient(BaseChatClient):
|
|
248
248
|
access_token=self.creds.token,
|
249
249
|
http_client=self.http_client,
|
250
250
|
)
|
251
|
-
elif self.endpoint.is_bedrock:
|
251
|
+
elif self.endpoint.is_bedrock or self.endpoint.endpoint_type == "anthropic_bedrock":
|
252
252
|
if self.endpoint.credentials is None:
|
253
253
|
raise ValueError("Anthropic Bedrock endpoint requires credentials")
|
254
254
|
return AnthropicBedrock(
|
@@ -747,7 +747,7 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
|
|
747
747
|
if self.endpoint.proxy is not None and self.http_client is None:
|
748
748
|
self.http_client = httpx.AsyncClient(proxy=self.endpoint.proxy)
|
749
749
|
|
750
|
-
if self.endpoint.is_vertex:
|
750
|
+
if self.endpoint.is_vertex or self.endpoint.endpoint_type == "anthropic_vertex":
|
751
751
|
if self.endpoint.credentials is None:
|
752
752
|
raise ValueError("Anthropic Vertex endpoint requires credentials")
|
753
753
|
self.creds = Credentials(
|
@@ -781,7 +781,7 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
|
|
781
781
|
access_token=self.creds.token,
|
782
782
|
http_client=self.http_client,
|
783
783
|
)
|
784
|
-
elif self.endpoint.is_bedrock:
|
784
|
+
elif self.endpoint.is_bedrock or self.endpoint.endpoint_type == "anthropic_bedrock":
|
785
785
|
if self.endpoint.credentials is None:
|
786
786
|
raise ValueError("Anthropic Bedrock endpoint requires credentials")
|
787
787
|
return AsyncAnthropicBedrock(
|
{vectorvein-0.2.21 → vectorvein-0.2.22}/src/vectorvein/chat_clients/openai_compatible_client.py
RENAMED
@@ -93,7 +93,7 @@ class OpenAICompatibleChatClient(BaseChatClient):
|
|
93
93
|
if self.endpoint.proxy is not None and self.http_client is None:
|
94
94
|
self.http_client = httpx.Client(proxy=self.endpoint.proxy)
|
95
95
|
|
96
|
-
if self.endpoint.is_azure:
|
96
|
+
if self.endpoint.is_azure or self.endpoint.endpoint_type == "openai_azure":
|
97
97
|
if self.endpoint.api_base is None:
|
98
98
|
raise ValueError("Azure endpoint is not set")
|
99
99
|
return AzureOpenAI(
|
@@ -568,7 +568,7 @@ class AsyncOpenAICompatibleChatClient(BaseAsyncChatClient):
|
|
568
568
|
if self.endpoint.proxy is not None and self.http_client is None:
|
569
569
|
self.http_client = httpx.AsyncClient(proxy=self.endpoint.proxy)
|
570
570
|
|
571
|
-
if self.endpoint.is_azure:
|
571
|
+
if self.endpoint.is_azure or self.endpoint.endpoint_type == "openai_azure":
|
572
572
|
if self.endpoint.api_base is None:
|
573
573
|
raise ValueError("Azure endpoint is not set")
|
574
574
|
return AsyncAzureOpenAI(
|
@@ -230,7 +230,12 @@ def get_token_counts(text: str | dict, model: str = "", use_token_server_first:
|
|
230
230
|
endpoint_id = endpoint_choice
|
231
231
|
endpoint = settings.get_endpoint(endpoint_id)
|
232
232
|
|
233
|
-
if
|
233
|
+
if (
|
234
|
+
endpoint.is_vertex
|
235
|
+
or endpoint.is_bedrock
|
236
|
+
or endpoint.endpoint_type == "anthropic_vertex"
|
237
|
+
or endpoint.endpoint_type == "anthropic_bedrock"
|
238
|
+
):
|
234
239
|
continue
|
235
240
|
elif endpoint.api_schema_type == "default":
|
236
241
|
return (
|
@@ -243,7 +248,7 @@ def get_token_counts(text: str | dict, model: str = "", use_token_server_first:
|
|
243
248
|
)
|
244
249
|
|
245
250
|
# TODO: Use anthropic token counting
|
246
|
-
warnings.warn("Anthropic token counting is not implemented yet")
|
251
|
+
warnings.warn("Anthropic token counting is not implemented in Vertex or Bedrock yet")
|
247
252
|
return len(get_gpt_4o_encoding().encode(text))
|
248
253
|
elif model.startswith("deepseek"):
|
249
254
|
from deepseek_tokenizer import deepseek_tokenizer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# @Author: Bi Ying
|
2
2
|
# @Date: 2024-07-26 23:48:04
|
3
|
-
from typing import List, Dict, Optional, Union, Iterable
|
3
|
+
from typing import List, Dict, Optional, Union, Iterable, Literal
|
4
4
|
|
5
5
|
import httpx
|
6
6
|
from pydantic import BaseModel, Field
|
@@ -31,7 +31,20 @@ class EndpointSetting(BaseModel):
|
|
31
31
|
region: Optional[str] = Field(None, description="The region for the endpoint.")
|
32
32
|
api_base: Optional[str] = Field(None, description="The base URL for the API.")
|
33
33
|
api_key: Optional[str] = Field(None, description="The API key for authentication.")
|
34
|
-
|
34
|
+
endpoint_type: Optional[
|
35
|
+
Literal[
|
36
|
+
"default",
|
37
|
+
"openai",
|
38
|
+
"openai_azure",
|
39
|
+
"anthropic",
|
40
|
+
"anthropic_vertex",
|
41
|
+
"anthropic_bedrock",
|
42
|
+
]
|
43
|
+
] = Field(
|
44
|
+
"default",
|
45
|
+
description="The type of endpoint. Set to 'default' will determine the type automatically.",
|
46
|
+
)
|
47
|
+
api_schema_type: Optional[Literal["default", "openai", "anthropic"]] = Field(
|
35
48
|
"default",
|
36
49
|
description="The type of client for the endpoint. Set to 'default' will determine the type automatically.",
|
37
50
|
)
|
@@ -70,7 +70,23 @@ class EndpointSettingDict(TypedDict):
|
|
70
70
|
api_base: NotRequired[Optional[str]]
|
71
71
|
api_key: NotRequired[str]
|
72
72
|
region: NotRequired[str]
|
73
|
-
|
73
|
+
endpoint_type: NotRequired[
|
74
|
+
Literal[
|
75
|
+
"default",
|
76
|
+
"openai",
|
77
|
+
"openai_azure",
|
78
|
+
"anthropic",
|
79
|
+
"anthropic_vertex",
|
80
|
+
"anthropic_bedrock",
|
81
|
+
]
|
82
|
+
]
|
83
|
+
api_schema_type: NotRequired[
|
84
|
+
Literal[
|
85
|
+
"default",
|
86
|
+
"openai",
|
87
|
+
"anthropic",
|
88
|
+
]
|
89
|
+
]
|
74
90
|
credentials: NotRequired[dict]
|
75
91
|
is_azure: NotRequired[bool]
|
76
92
|
is_vertex: NotRequired[bool]
|
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
|
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
|