mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-13 14:10:59 +00:00
feat: ollama embeddings models
This commit is contained in:
@@ -129,3 +129,15 @@ class OllamaChatCompletions(requester.ProviderAPIRequester):
|
|||||||
)
|
)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
raise errors.RequesterError('请求超时')
|
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,
|
||||||
|
)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ spec:
|
|||||||
default: 120
|
default: 120
|
||||||
support_type:
|
support_type:
|
||||||
- llm
|
- llm
|
||||||
|
- text-embedding
|
||||||
execution:
|
execution:
|
||||||
python:
|
python:
|
||||||
path: ./ollamachat.py
|
path: ./ollamachat.py
|
||||||
|
|||||||
Reference in New Issue
Block a user