feat: ollama embeddings models

This commit is contained in:
Junyan Qin
2025-07-24 10:36:32 +08:00
parent abc88c4979
commit 7aed5cf1ed
2 changed files with 13 additions and 0 deletions

View File

@@ -129,3 +129,15 @@ class OllamaChatCompletions(requester.ProviderAPIRequester):
)
except asyncio.TimeoutError:
raise errors.RequesterError('请求超时')
async def invoke_embedding(
self,
model: requester.RuntimeEmbeddingModel,
input_text: list[str],
extra_args: dict[str, typing.Any] = {},
) -> list[list[float]]:
return await self.client.embed(
model=model.model_entity.name,
input=input_text,
**extra_args,
)

View File

@@ -24,6 +24,7 @@ spec:
default: 120
support_type:
- llm
- text-embedding
execution:
python:
path: ./ollamachat.py