Skip to content

Commit dcd7690

Browse files
authored
Bump Cohere SDK and remove incorrect typing workaround (#2886)
1 parent cd69073 commit dcd7690

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pydantic_ai_slim/pydantic_ai/models/cohere.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def _process_response(self, response: V2ChatResponse) -> ModelResponse:
207207
if content.type == 'text':
208208
parts.append(TextPart(content=content.text))
209209
elif content.type == 'thinking': # pragma: no branch
210-
parts.append(ThinkingPart(content=cast(str, content.thinking))) # pyright: ignore[reportUnknownMemberType,reportAttributeAccessIssue] - https://github.com/cohere-ai/cohere-python/issues/692
210+
parts.append(ThinkingPart(content=content.thinking))
211211
for c in response.message.tool_calls or []:
212212
if c.function and c.function.name and c.function.arguments: # pragma: no branch
213213
parts.append(
@@ -258,7 +258,7 @@ def _map_messages(self, messages: list[ModelMessage]) -> list[ChatMessageV2]:
258258
if texts or thinking:
259259
contents: list[AssistantMessageV2ContentItem] = []
260260
if thinking:
261-
contents.append(ThinkingAssistantMessageV2ContentItem(thinking='\n\n'.join(thinking))) # pyright: ignore[reportCallIssue] - https://github.com/cohere-ai/cohere-python/issues/692
261+
contents.append(ThinkingAssistantMessageV2ContentItem(thinking='\n\n'.join(thinking)))
262262
if texts: # pragma: no branch
263263
contents.append(TextAssistantMessageV2ContentItem(text='\n\n'.join(texts)))
264264
message_param.content = contents

pydantic_ai_slim/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dependencies = [
6868
logfire = ["logfire[httpx]>=3.14.1"]
6969
# Models
7070
openai = ["openai>=1.99.9"]
71-
cohere = ["cohere>=5.17.0; platform_system != 'Emscripten'"]
71+
cohere = ["cohere>=5.18.0; platform_system != 'Emscripten'"]
7272
vertexai = ["google-auth>=2.36.0", "requests>=2.32.2"]
7373
google = ["google-genai>=1.31.0"]
7474
anthropic = ["anthropic>=0.61.0"]

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)