Scaffold a custom Cohere connector
Project description
Create Cohere Connector
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.
Note that this is an experimental project. If something doesn’t work, please file an issue.
You might also refer to the official Cohere repo for Connectors: https://github.com/cohere-ai/quick-start-connectors
🧮 What is included?
Your environment will have everything you need to quickly prototype and deploy a custom Cohere Connector:
API service
implementing the requiredsearch
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
- Install
create-cohere-connector
package:
You might install this package globall:
poetry self add poetry-scaffold
or within a virtual environment:
# Windows
py -m venv .venv
.venv\scripts\activate
# macOS/Linux
python3 -m venv .venv
source .venv/bin/activate
pip3 install create-cohere-connector
- Bootstrap your project:
poetry run 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!
- Set environment variables
You might rename .env_template
to .env
, and complete it.
- Span a shell within the virtual environment
poetry shell
- Install dependencies
poetry config virtualenvs.in-project true
poetry install --no-root
- Start API service
poetry run uvicorn app:app --app-dir provider --port 5000 --reload
- Deploy Cohere Connector
python deploy.py
👩💻 Contributions
If you would like to contribute, here are some features that we are planning to add:
- Improve Poetry virtual environment creation
- 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
Built Distribution
Hashes for create_cohere_connector-0.1.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7048c5374c05551dbe3d82a1c6ebf289e624cc610b88e3cd3cbaeb0d63bc68ee |
|
MD5 | 2614e0dbe720edc2fee74b46ef0d8bff |
|
BLAKE2b-256 | 3dd6dd54ac32c97ec25b9c292ea2f3df78022f320f3165d2c0386633d946a534 |
Hashes for create_cohere_connector-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcfd65b7242598f7c516da8ff0cc3852f20cedaaa5cef2548c28f98933afc27e |
|
MD5 | 5257dd06e3fd469a7b4aab5bb0f9c4b8 |
|
BLAKE2b-256 | c47e43a9f8edb7339bdfada74291801e0e35567d944b6dc6125d63b8cadf221e |