cohere-upgrade-migration

Featured

Migrate from Cohere API v1 to v2 and upgrade SDK versions. Use when upgrading cohere-ai SDK, migrating from CohereClient to CohereClientV2, or handling breaking changes between API versions. Trigger with phrases like "upgrade cohere", "cohere migration", "cohere v1 to v2", "update cohere SDK", "cohere breaking changes".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Cohere Upgrade & Migration ## Overview Guide for migrating from Cohere API v1 to v2 and upgrading the `cohere-ai` TypeScript / `cohere` Python SDK. Covers every breaking change with before/after code. ## Prerequisites - Current Cohere SDK installed - Git for version control - Test suite available ## Instructions ### Step 1: Check Current Version ```bash # TypeScript npm list cohere-ai # Python pip show cohere # Latest versions npm view cohere-ai version pip index versions cohere ``` ### Step 2: Create Upgrade Branch ```bash git checkout -b upgrade/cohere-v2-migration npm install cohere-ai@latest # or: pip install cohere --upgrade ``` ### Step 3: API v1 to v2 Breaking Changes #### Client Import ```typescript // v1 import { CohereClient } from 'cohere-ai'; const cohere = new CohereClient({ token: '...' }); // v2 import { CohereClientV2 } from 'cohere-ai'; const cohere = new CohereClientV2({ token: '...' }); ``` #### Chat Endpoint — Messages Format ```typescript // v1 — single message string const response = await cohere.chat({ message: 'Hello', preamble: 'You are helpful.', chatHistory: [ { role: 'USER', message: 'Hi' }, { role: 'CHATBOT', message: 'Hello!' }, ], }); console.log(response.text); // v2 — OpenAI-compatible messages array, model required const response = await cohere.chat({ model: 'command-a-03-2025', // REQUIRED in v2 messages: [ { role: 'system', content: 'You are helpful.' }, { role: 'user', content: 'Hi' }, { r...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category