ccurme
afe89a1411
community: add standard chat model params to Ollama ( #22446 )
2024-06-03 17:45:03 -04:00
P. Taylor Goetz
9317df7f16
community[patch]: Add "model" attribute to the payload sent to Ollama in ChatOllama
( #20354 )
...
Example Ollama API calls:
Request without "model":
```
curl --location 'http://localhost:11434/api/chat ' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": "What is the capitol of PA?"
}
],
"stream": false
}'
```
Response:
```
{"error":"model is required"}
```
Request with "model":
```
curl --location 'http://localhost:11434/api/chat ' \
--header 'Content-Type: application/json' \
--data '{
"model": "openchat",
"messages": [
{
"role": "user",
"content": "What is the capitol of PA?"
}
],
"stream": false
}'
```
Response:
```
{
"eval_duration" : 733248000,
"created_at" : "2024-04-11T23:04:08.735766843Z",
"model" : "openchat",
"message" : {
"content" : " The capital city of Pennsylvania is Harrisburg.",
"role" : "assistant"
},
"total_duration" : 3138731168,
"prompt_eval_count" : 25,
"load_duration" : 466562959,
"done" : true,
"prompt_eval_duration" : 1938495000,
"eval_count" : 10
}
```
2024-04-12 13:32:53 -04:00
mackong
2c42f3a955
ollama[patch]: delete suffix slash to avoid redirect ( #18260 )
...
- **Description:** see
[ollama](https://github.com/ollama/ollama/blob/main/server/routes.go#L949 )'s
route definitions
- **Issue:** N/A
- **Dependencies:** N/A
2024-02-28 16:44:48 -05:00
mackong
9678797625
community[patch]: callback before yield for _stream/_astream ( #17907 )
...
- Description: callback on_llm_new_token before yield chunk for
_stream/_astream for some chat models, make all chat models in a
consistent behaviour.
- Issue: N/A
- Dependencies: N/A
2024-02-22 16:15:21 -08:00
mackong
31891092d8
community[patch]: add missing chunk parameter for _stream/_astream ( #17807 )
...
- Description: Add missing chunk parameter for _stream/_astream for some
chat models, make all chat models in a consistent behaviour.
- Issue: N/A
- Dependencies: N/A
2024-02-21 15:32:28 -08:00
Robby
e135dc70c3
community[patch]: Invoke callback prior to yielding token ( #17348 )
...
**Description:** Invoke callback prior to yielding token in stream
method for Ollama.
**Issue:** [Callback for on_llm_new_token should be invoked before the
token is yielded by the model
#16913 ](https://github.com/langchain-ai/langchain/issues/16913 )
Co-authored-by: Robby <h0rv@users.noreply.github.com>
2024-02-12 19:22:55 -08:00
Bagatur
66e45e8ab7
community[patch]: chat model mypy fixes ( #17061 )
...
Related to #17048
2024-02-05 13:42:59 -08:00
Harrison Chase
4eda647fdd
infra: add -p to mkdir in lint steps ( #17013 )
...
Previously, if this did not find a mypy cache then it wouldnt run
this makes it always run
adding mypy ignore comments with existing uncaught issues to unblock other prs
---------
Co-authored-by: Erick Friis <erick@langchain.dev>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
2024-02-05 11:22:06 -08:00
shroominic
694bbb14cd
community: fix typo in async ollama chat ( #15276 )
...
Made a stupid typo in the last PR which got already merged😅
2023-12-28 09:56:55 -08:00
shroominic
e6f0cee896
community: Async Ollama + ChatOllama ( #15169 )
...
**Description:**
Adding async methods to booth OllamaLLM and ChatOllama to enable async
streaming and async .on_llm_new_token callbacks.
**Issue:**
ChatOllama is not working in combination with an AsyncCallbackManager
because the .on_llm_new_token method is not awaited.
2023-12-26 12:08:04 -08:00
Lance Martin
42421860bc
Add image support for Ollama ( #14713 )
...
Support [LLaVA](https://ollama.ai/library/llava ):
* Upgrade Ollama
* `ollama pull llava`
Ensure compatibility with [image prompt
template](https://github.com/langchain-ai/langchain/pull/14263 )
---------
Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
2023-12-15 16:00:55 -08:00
Bagatur
ed58eeb9c5
community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community ( #14463 )
...
Moved the following modules to new package langchain-community in a backwards compatible fashion:
```
mv langchain/langchain/adapters community/langchain_community
mv langchain/langchain/callbacks community/langchain_community/callbacks
mv langchain/langchain/chat_loaders community/langchain_community
mv langchain/langchain/chat_models community/langchain_community
mv langchain/langchain/document_loaders community/langchain_community
mv langchain/langchain/docstore community/langchain_community
mv langchain/langchain/document_transformers community/langchain_community
mv langchain/langchain/embeddings community/langchain_community
mv langchain/langchain/graphs community/langchain_community
mv langchain/langchain/llms community/langchain_community
mv langchain/langchain/memory/chat_message_histories community/langchain_community
mv langchain/langchain/retrievers community/langchain_community
mv langchain/langchain/storage community/langchain_community
mv langchain/langchain/tools community/langchain_community
mv langchain/langchain/utilities community/langchain_community
mv langchain/langchain/vectorstores community/langchain_community
mv langchain/langchain/agents/agent_toolkits community/langchain_community
mv langchain/langchain/cache.py community/langchain_community
mv langchain/langchain/adapters community/langchain_community
mv langchain/langchain/callbacks community/langchain_community/callbacks
mv langchain/langchain/chat_loaders community/langchain_community
mv langchain/langchain/chat_models community/langchain_community
mv langchain/langchain/document_loaders community/langchain_community
mv langchain/langchain/docstore community/langchain_community
mv langchain/langchain/document_transformers community/langchain_community
mv langchain/langchain/embeddings community/langchain_community
mv langchain/langchain/graphs community/langchain_community
mv langchain/langchain/llms community/langchain_community
mv langchain/langchain/memory/chat_message_histories community/langchain_community
mv langchain/langchain/retrievers community/langchain_community
mv langchain/langchain/storage community/langchain_community
mv langchain/langchain/tools community/langchain_community
mv langchain/langchain/utilities community/langchain_community
mv langchain/langchain/vectorstores community/langchain_community
mv langchain/langchain/agents/agent_toolkits community/langchain_community
mv langchain/langchain/cache.py community/langchain_community
```
Moved the following to core
```
mv langchain/langchain/utils/json_schema.py core/langchain_core/utils
mv langchain/langchain/utils/html.py core/langchain_core/utils
mv langchain/langchain/utils/strings.py core/langchain_core/utils
cat langchain/langchain/utils/env.py >> core/langchain_core/utils/env.py
rm langchain/langchain/utils/env.py
```
See .scripts/community_split/script_integrations.sh for all changes
2023-12-11 13:53:30 -08:00