Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pydantic_ai_slim/pydantic_ai/models/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _process_response(self, response: V2ChatResponse) -> ModelResponse:
if content.type == 'text':
parts.append(TextPart(content=content.text))
elif content.type == 'thinking': # pragma: no branch
parts.append(ThinkingPart(content=cast(str, content.thinking))) # pyright: ignore[reportUnknownMemberType,reportAttributeAccessIssue] - https://github.com/cohere-ai/cohere-python/issues/692
parts.append(ThinkingPart(content=content.thinking))
for c in response.message.tool_calls or []:
if c.function and c.function.name and c.function.arguments: # pragma: no branch
parts.append(
Expand Down Expand Up @@ -258,7 +258,7 @@ def _map_messages(self, messages: list[ModelMessage]) -> list[ChatMessageV2]:
if texts or thinking:
contents: list[AssistantMessageV2ContentItem] = []
if thinking:
contents.append(ThinkingAssistantMessageV2ContentItem(thinking='\n\n'.join(thinking))) # pyright: ignore[reportCallIssue] - https://github.com/cohere-ai/cohere-python/issues/692
contents.append(ThinkingAssistantMessageV2ContentItem(thinking='\n\n'.join(thinking)))
if texts: # pragma: no branch
contents.append(TextAssistantMessageV2ContentItem(text='\n\n'.join(texts)))
message_param.content = contents
Expand Down
2 changes: 1 addition & 1 deletion pydantic_ai_slim/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies = [
logfire = ["logfire[httpx]>=3.14.1"]
# Models
openai = ["openai>=1.99.9"]
cohere = ["cohere>=5.17.0; platform_system != 'Emscripten'"]
cohere = ["cohere>=5.18.0; platform_system != 'Emscripten'"]
vertexai = ["google-auth>=2.36.0", "requests>=2.32.2"]
google = ["google-genai>=1.31.0"]
anthropic = ["anthropic>=0.61.0"]
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.