Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Cohere ai Cohere python CitationOptions Model

From Leeroopedia
Knowledge Sources
Domains SDK, Citations, Configuration
Last Updated 2026-02-15 14:00 GMT

Overview

CitationOptions is a Pydantic model that configures citation generation behavior for the Cohere V2 chat API.

Description

The CitationOptions model provides a single mode field of type CitationOptionsMode that controls how citations are generated in chat responses. The mode accepts the following string values:

  • "ENABLED" -- Citations are enabled (default behavior for supported models).
  • "DISABLED" -- Citations are explicitly turned off.
  • "FAST" -- Citations use a faster but potentially less precise generation method.
  • "ACCURATE" -- Citations use a more precise but potentially slower generation method.
  • "OFF" -- Alias for disabling citations.

When not specified, citations default to enabled for models that support them.

Usage

Use CitationOptions when you need to control citation generation behavior in a V2 chat request. Pass it as the citation_options parameter to fine-tune whether citations are generated and the trade-off between speed and accuracy.

Code Reference

Source Location

Signature

class CitationOptions(UncheckedBaseModel):
    mode: typing.Optional[CitationOptionsMode] = pydantic.Field(default=None)

Import

from cohere.types import CitationOptions

I/O Contract

Fields

Field Type Required Description
mode Optional[CitationOptionsMode] No The citation generation mode. Accepted values: "ENABLED", "DISABLED", "FAST", "ACCURATE", "OFF". Defaults to "ENABLED" for models that support citations.

CitationOptionsMode Values

Value Description
"ENABLED" Enable citation generation (default).
"DISABLED" Disable citation generation.
"FAST" Use fast citation generation mode.
"ACCURATE" Use accurate citation generation mode.
"OFF" Turn off citation generation.

Usage Examples

from cohere.types import CitationOptions

# Enable accurate citations
response = client.chat(
    model="command-a-03-2025",
    messages=[{"role": "user", "content": "Summarize the document."}],
    documents=[{"id": "doc1", "data": {"text": "Revenue grew 15%."}}],
    citation_options=CitationOptions(mode="ACCURATE"),
)

# Disable citations entirely
response = client.chat(
    model="command-a-03-2025",
    messages=[{"role": "user", "content": "Hello!"}],
    citation_options=CitationOptions(mode="OFF"),
)

# Use fast citation mode for lower latency
response = client.chat(
    model="command-a-03-2025",
    messages=[{"role": "user", "content": "What does the report say?"}],
    documents=[{"id": "doc1", "data": {"text": "Costs decreased by 10%."}}],
    citation_options=CitationOptions(mode="FAST"),
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment