Skip to main content

Overview

Cohere provides enterprise-grade language models including Command R+ with strong multilingual capabilities and retrieval-augmented generation. Model Class: CohereModel

Authentication

export CO_API_KEY="..."

Examples

from upsonic import Agent, Task
from upsonic.models.cohere import CohereModel

model = CohereModel(model_name="command-r-plus")
agent = Agent(model=model)

task = Task("Hello, how are you?")
result = agent.do(task)
print(result)

Parameters

ParameterTypeDescriptionDefaultSource
max_tokensintMaximum tokens to generate4096Base
temperaturefloatSampling temperature (0.0-1.0)0.3Base
top_pfloatNucleus sampling0.75Base
seedintRandom seedNoneBase
stop_sequenceslist[str]Stop sequencesNoneBase
presence_penaltyfloatToken presence penalty0.0Base
frequency_penaltyfloatToken frequency penalty0.0Base