cohere-hello-world

Featured

Create a minimal working Cohere example with Chat, Embed, and Rerank. Use when starting a new Cohere integration, testing your setup, or learning basic Cohere API v2 patterns. Trigger with phrases like "cohere hello world", "cohere example", "cohere quick start", "simple cohere code".

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 Hello World ## Overview Three minimal working examples: Chat completion, text embedding, and search reranking. Each demonstrates a core Cohere API v2 endpoint. ## Prerequisites - Completed `cohere-install-auth` setup - `cohere-ai` package installed - `CO_API_KEY` environment variable set ## Instructions ### Example 1: Chat Completion ```typescript import { CohereClientV2 } from 'cohere-ai'; const cohere = new CohereClientV2(); async function chat() { const response = await cohere.chat({ model: 'command-a-03-2025', messages: [ { role: 'system', content: 'You are a helpful coding assistant.' }, { role: 'user', content: 'Explain what a closure is in JavaScript in 2 sentences.' }, ], }); console.log(response.message?.content?.[0]?.text); } chat().catch(console.error); ``` ### Example 2: Text Embedding ```typescript async function embed() { const response = await cohere.embed({ model: 'embed-v4.0', texts: ['Cohere builds enterprise AI', 'LLMs power modern search'], inputType: 'search_document', embeddingTypes: ['float'], }); const vectors = response.embeddings.float; console.log(`Generated ${vectors.length} embeddings`); console.log(`Dimensions: ${vectors[0].length}`); } embed().catch(console.error); ``` ### Example 3: Search Reranking ```typescript async function rerank() { const response = await cohere.rerank({ model: 'rerank-v3.5', query: 'What is machine learning?', documents: [ ...

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