Skip to content

Commit

Permalink
Add support for Internet connector in chatbot models
Browse files Browse the repository at this point in the history
  • Loading branch information
ckt1031 committed Apr 29, 2024
1 parent 30ca9e7 commit 7fa213c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Cohere To OpenAI (Cloudflare Worker)

[简体中文](./docs/README-zh-CN.md)

This is a simple Cloudflare Worker that transform Cohere API to OpenAI API, easily deployable to Cloudflare Workers.

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/ckt1031/cohere2openai-cf-worker)
Expand All @@ -9,8 +11,15 @@ This is a simple Cloudflare Worker that transform Cohere API to OpenAI API, easi
- [x] Transform Cohere API to OpenAI API
- [x] Model listing endpoint (GET /models)
- [x] Chat completion endpoint (POST /chat/completions)
- [x] Detect `-internet` in model to use Internet connector
- [ ] Tool Calling feature

## Special Internet Model

To enable the use of the Internet connector in any chatbot client, we support models with `-internet` in their name. While this is an unofficial feature, it helps reduce additional costs associated with using the Internet connector.

To utilize the Internet connector, simply append `-internet` to the model name. For example, `command-r-plus` would become `command-r-plus-internet`.

## How to Deploy

1. Clone this repository: `git clone https://github.com/ckt1031/cohere2openai-cf-worker.git --depth=1`
Expand Down
23 changes: 23 additions & 0 deletions docs/README-zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Cohere To OpenAI (Cloudflare Worker)

[English](../README.md)

这是一个简单的 Cloudflare Worker,可以将 Cohere API 转换为 OpenAI API,并且可以轻松部署到 Cloudflare Workers。

[![部署到 Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/ckt1031/cohere2openai-cf-worker)

## 特殊的 Internet 模型

为了在任何聊天机器人客户端中启用 Internet 连接器的使用,我们支持在模型名称中包含 `-internet` 的模型。虽然这是一个非官方功能,但它有助于减少使用 Internet 连接器相关的额外成本。

要使用 Internet 连接器,只需在模型名称后面添加 `-internet` 即可。例如,`command-r-plus` 将变成 `command-r-plus-internet`

## 如何部署

1. 克隆此仓库:`git clone https://github.com/ckt1031/cohere2openai-cf-worker.git --depth=1`
2. 运行 `npm install` 安装依赖项
3. 运行 `npm run deploy` 部署到 Cloudflare Workers

## 许可证

本项目采用 [MIT 许可证](../LICENSE)

0 comments on commit 7fa213c

Please sign in to comment.