Skip to main content

Scaffold a custom Cohere connector

Project description

Create Cohere Connector PRs Welcome

Generates a custom Cohere Connector with one command. Cohere Connectors enable to combine Cohere's large language models (LLMs), which power the Chat API, with up-to-date factual information. They enhance Cohere's retrieval augmented generation (RAG) offering, and can respond to user questions and prompts with substantive, grounded generations that contain citations to external public or private knowledge bases.

If something doesn’t work, please file an issue.

🧮 What is included?

Your environment will have everything you need to quickly prototype and deploy a custom Cohere Connector:

  • API service implementing the required search endpoint using FastAPI (support for Flask is planned).
  • Bearer Token Authentication using the Authorization header in HTTP requests.
  • Pydantic models for data validation and serialization.
  • Client class to retrieve data from a custom data source.
  • Deploy script to register your connector with Cohere.

🚀 Quickstart

  1. Install create-cohere-connector package:
pip install create-cohere-connector
  1. Bootstrap your project:
create-cohere-connector

This will prompt for a project name:

Project name [myconnector]: hello-connector
Api framework [FastAPI]: FastAPI
Authentication [Bearer]: Bearer
Caching [None]: None

generate the initial project structure:

myconnector
├── README.md
├── deploy.py
├── Dockerfile
├── pyproject.toml
├── poetry.lock
├── .gitignore
└── provider
    ├── __init__.py
    ├── app.py
    ├── client.py
    └── datamodels.py

and install dependencies:

 Project created successfully!
  1. Set environment variables

You might rename .env_template to .env, and complete it.

  1. Start API service

Inside the provider directory:

uvicorn app:app --reload
  1. Deploy Cohere Connector
python deploy.py

👩‍💻 Contributions

If you would like to contribute, here are some features that we are planning to add:

  • Flask support
  • Semantic caching
  • OAuth 2.0
  • Data models scaffolding

⚖️ License

Create Cohere Connector is open source software licensed as Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

create_cohere_connector-0.1.9.tar.gz (11.4 kB view hashes)

Uploaded Source

Built Distribution

create_cohere_connector-0.1.9-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page