For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
  • Get Started
    • Introduction
    • Installation
    • Creating a client
    • Playground
    • FAQs
  • Models
    • An Overview of Cohere's Models
    • Embed
    • Rerank
    • Aya
  • Text Generation
    • Introduction to Text Generation at Cohere
    • Using the Chat API
    • Streaming Responses
    • Structured Outputs
    • Predictable Outputs
    • Advanced Generation Parameters
    • Retrieval Augmented Generation (RAG)
    • Tool Use
    • Tokens and Tokenizers
    • Migrating from the Generate API to the Chat API
    • Summarizing Text
    • Safety Modes
  • Embeddings (Vectors, Search, Retrieval)
    • Introduction to Embeddings at Cohere
    • Semantic Search with Embeddings
    • Multimodal Embeddings
    • Batch Embedding Jobs
  • Going to Production
    • API Keys and Rate Limits
    • Going Live
    • Deprecations
    • How Does Cohere's Pricing Work?
  • Integrations
    • Integrating Embedding Models with Other Tools
    • Cohere and LangChain
    • LlamaIndex and Cohere
  • Deployment Options
    • Overview
    • SDK Compatibility
  • Tutorials
    • Cookbooks
    • LLM University
    • Build Things with Cohere!
      • Cohere Text Generation Tutorial
      • Building a Chatbot with Cohere
      • Semantic Search with Cohere
      • Reranking with Cohere
      • RAG with Cohere
      • Building an Agent with Cohere
  • Responsible Use
    • Security
    • Usage Policy
    • Command A Technical Report
    • Command R and Command R+ Model Card
  • Cohere Labs
    • Cohere Labs Acceptable Use Policy
  • More Resources
    • Cohere Toolkit
    • Datasets
    • Improve Cohere Docs
LogoLogodocs
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
On this page
  • Installation and Setup
  • Accessing Cohere from Other Platforms
  • Amazon Bedrock
  • Amazon SageMaker
  • Microsoft Azure
Tutorials

Build an Onboarding Assistant with Cohere!

Was this page helpful?
Edit this page
Previous

Cohere Text Generation Tutorial

Next
Built with

Welcome to our hands-on introduction to Cohere! This section is split over seven different tutorials, each focusing on one use case leveraging our Chat, Embed, and Rerank endpoints:

  • Part 1: Installation and Setup (the document you’re reading now)
  • Part 2: Text Generation
  • Part 3: Chatbots
  • Part 4: Semantic Search
  • Part 5: Reranking
  • Part 6: Retrieval-Augmented Generation (RAG)
  • Part 7: Agents with Tool Use

Your learning is structured around building an onboarding assistant that helps new hires at Co1t, a fictitious company. The assistant can help write introductions, answer user questions about the company, search for information from e-mails, and create meeting appointments.

We recommend that you follow the parts sequentially. However, feel free to skip to specific parts if you want (apart from Part 1, which is a pre-requisite) because each part also works as a standalone tutorial.

Installation and Setup

The Cohere platform lets developers access large language model (LLM) capabilities with a few lines of code. These LLMs can solve a broad spectrum of natural language use cases, including classification, semantic search, paraphrasing, summarization, and content generation.

Cohere’s models can be accessed through the playground and SDK. We support SDKs in four different languages: Python, Typescript, Java, and Go. For these tutorials, we’ll use the Python SDK and access the models through the Cohere platform with an API key.

To get started, first install the Cohere Python SDK.

PYTHON
1! pip install -U cohere

Next, we’ll import the cohere library and create a client to be used throughout the examples. We create a client by passing the Cohere API key as an argument. To get an API key, sign up with Cohere and get the API key from the dashboard.

PYTHON
1import cohere
2
3# Get your API key here: https://dashboard.cohere.com/api-keys
4co = cohere.Client(api_key="YOUR_COHERE_API_KEY")

Accessing Cohere from Other Platforms

The Cohere platform is the fastest way to access Cohere’s models and get started.

However, if you prefer other options, you can access Cohere’s models through other platforms such as Amazon Bedrock, Amazon SageMaker, Azure AI Studio, and Oracle Cloud Infrastructure (OCI) Generative AI Service.

Read this documentation on Cohere SDK cloud platform compatibility. In this sections below we sketch what it looks like to access Cohere models through other means, but we link out to more extensive treatments if you’d like additional detail.

Amazon Bedrock

The following is how you can create a Cohere client on Amazon Bedrock.

For further information, read this documentation on Cohere on Bedrock.

PYTHON
1import cohere
2
3co = cohere.BedrockClient(
4 aws_region="...",
5 aws_access_key="...",
6 aws_secret_key="...",
7 aws_session_token="...",
8)

Amazon SageMaker

The following is how you can create a Cohere client on Amazon SageMaker.

For further information, read this documentation on Cohere on SageMaker.

PYTHON
1import cohere
2
3co = cohere.SagemakerClient(
4 aws_region="us-east-1",
5 aws_access_key="...",
6 aws_secret_key="...",
7 aws_session_token="...",
8)

Microsoft Azure

The following is how you can create a Cohere client on Microsoft Azure.

For further information, read this documentation on Cohere on Azure.

PYTHON
1import cohere
2
3co = cohere.Client(
4 api_key="...",
5 base_url="...",
6)

In Part 2, we’ll get started with the first use case - text generation.