mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-02-05 14:23:23 +08:00
ollama兼容
This commit is contained in:
parent
0470b8ae41
commit
2bb24d8b6d
@ -31,7 +31,7 @@ ollama:
|
|||||||
- model: 'llama3'
|
- model: 'llama3'
|
||||||
model_type: 'llm'
|
model_type: 'llm'
|
||||||
model_credentials:
|
model_credentials:
|
||||||
base_url: 'http://172.21.80.1:11434'
|
base_url: 'http://172.21.192.1:11434'
|
||||||
mode: 'completion'
|
mode: 'completion'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ ollama:
|
|||||||
- model: 'llama3'
|
- model: 'llama3'
|
||||||
model_type: 'llm'
|
model_type: 'llm'
|
||||||
model_credentials:
|
model_credentials:
|
||||||
base_url: 'http://172.21.80.1:11434/v1'
|
base_url: 'http://172.21.192.1:11434/v1'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -652,13 +652,16 @@ class OllamaLargeLanguageModel(_CommonOllama, LargeLanguageModel):
|
|||||||
if user:
|
if user:
|
||||||
extra_model_kwargs["user"] = user
|
extra_model_kwargs["user"] = user
|
||||||
|
|
||||||
|
extra_body = {
|
||||||
|
**model_parameters,
|
||||||
|
**extra_model_kwargs,
|
||||||
|
}
|
||||||
# chat model
|
# chat model
|
||||||
response = client.chat.completions.create(
|
response = client.chat.completions.create(
|
||||||
messages=[self._convert_prompt_message_to_dict(m) for m in prompt_messages],
|
messages=[self._convert_prompt_message_to_dict(m) for m in prompt_messages],
|
||||||
model=model,
|
model=model,
|
||||||
stream=stream,
|
stream=stream,
|
||||||
**model_parameters,
|
extra_body=extra_body
|
||||||
**extra_model_kwargs,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if stream:
|
if stream:
|
||||||
|
|||||||
@ -4,7 +4,7 @@ ollama:
|
|||||||
- model: 'llama3'
|
- model: 'llama3'
|
||||||
model_type: 'llm'
|
model_type: 'llm'
|
||||||
model_credentials:
|
model_credentials:
|
||||||
base_url: 'http://172.21.80.1:11434/v1'
|
base_url: 'http://172.21.192.1:11434/v1'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ ollama:
|
|||||||
- model: 'llama3'
|
- model: 'llama3'
|
||||||
model_type: 'llm'
|
model_type: 'llm'
|
||||||
model_credentials:
|
model_credentials:
|
||||||
openai_api_base: 'http://172.21.80.1:11434'
|
openai_api_base: 'http://172.21.192.1:11434'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ ollama:
|
|||||||
- model: 'llama3'
|
- model: 'llama3'
|
||||||
model_type: 'llm'
|
model_type: 'llm'
|
||||||
model_credentials:
|
model_credentials:
|
||||||
base_url: 'http://172.21.80.1:11434/v1'
|
base_url: 'http://172.21.192.1:11434/v1'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user