Skip to content

Commit 34c2798

Browse files
fredricenmdrxy
andauthored
Update ollama.mdx (#1352)
fixed some problem ## Overview <!-- Brief description of what documentation is being added/updated --> ## Type of change **Type:** [Replace with: New documentation page / Update existing documentation / Fix typo/bug/link/formatting / Remove outdated content / Other] ## Related issues/PRs <!-- Link to related issues, feature PRs, or discussions (if applicable) To automatically close an issue when this PR is merged, use closing keywords: - "closes #123" or "fixes #123" or "resolves #123" For regular references without auto-closing, just use: - "#123" or "See issue #123" Examples: - closes #456 (will auto-close issue #456 when PR is merged) - See #789 for context (will reference but not auto-close issue #789) --> - GitHub issue: - Feature PR: <!-- For LangChain employees, if applicable: --> - Linear issue: - Slack thread: ## Checklist <!-- Put an 'x' in all boxes that apply --> - [ ] I have read the [contributing guidelines](README.md) - [ ] I have tested my changes locally using `docs dev` - [ ] All code examples have been tested and work correctly - [ ] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed - I have gotten approval from the relevant reviewers - (Internal team members only / optional) I have created a preview deployment using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml) ## Additional notes <!-- Any other information that would be helpful for reviewers --> --------- Co-authored-by: Mason Daugherty <mason@langchain.dev>
1 parent 5c794fd commit 34c2798

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/oss/python/integrations/chat/ollama.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ Some models, such as IBM's [Granite 3.2](https://ollama.com/library/granite3.2),
265265
To access Granite 3.2's thinking features, pass a message with a `"control"` role with content set to `"thinking"`. Because `"control"` is a non-standard message role, we can use a [ChatMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.chat.ChatMessage.html) object to implement it:
266266

267267
```python
268-
from langchain.messages import ChatMessage, HumanMessage
268+
from langchain.messages import HumanMessage
269+
from langchain_core.messages import ChatMessage
269270
from langchain_ollama import ChatOllama
270271

271272
llm = ChatOllama(model="granite3.2:8b")

0 commit comments

Comments
 (0)