Skip to content

feat: support cohere llm#31

Open
shukawam wants to merge 4 commits intoKong:mainfrom
shukawam:feat/add-cohere-llm
Open

feat: support cohere llm#31
shukawam wants to merge 4 commits intoKong:mainfrom
shukawam:feat/add-cohere-llm

Conversation

@shukawam
Copy link
Contributor

@shukawam shukawam commented Oct 29, 2025

Issue: #30

Overview

  • Added support for Cohere LLM.
  • Using the OpenAI SDK because Cohere has an OpenAI-compatible endpoint.
    • Please let me know if using the Cohere SDK in the implementation is preferable.
  • Maybe CI is failed because COHERE_API_KEY is not set to repo secret...

Usage example

import { agent, llmCohere } from "../dist/volcano-sdk.js";

// Run with: npx tsx examples/basic.ts
// (make sure COHERE_API_KEY is set)

(async () => {
  const llm = llmCohere({
    apiKey: process.env.COHERE_API_KEY!,
    model: "command-a-03-2025",
  });
  const results = await agent({ llm })
    .then({ prompt: `What is the Earch?` })
    .run();

  const firstResult = results[0];
  if (!firstResult || !firstResult.llmOutput) {
    throw new Error("The agent returned no results.");
  }
  console.log(firstResult.llmOutput);
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant