Commit Graph

56 Commits

Author SHA1 Message Date
Laisky.Cai
d4703dfd97 feat: add Proxy channel type and relay mode
Add the Proxy channel type and relay mode to support proxying requests to custom upstream services.
2024-07-21 13:42:13 +00:00
Laisky.Cai
adba54acd3
fix: implement improved headers for anthropic to support 8k outputs (#1654) 2024-07-16 23:48:54 +08:00
zijiren
6209ff9ea9
feat: vertexai support proxy url(example: cloudflare ai gateway) and fix some vertexai bug (#1642)
* feat: vertexai support proxy url(example: cloudflare ai gateway)

* fix: do resp model mapping

* fix: missing system

* fix: stream need query alt=sse
2024-07-16 01:02:06 +08:00
LiuVaayne
cf9b5f0b92
feat: support claude and gemini in vertex ai (#1621)
* feat: support claude and gemini in vertex ai

* fix: do not show api key field in channel page when the type is VertexAI

* fix: update getToken function to include channelId in cache key
2024-07-13 14:59:28 +08:00
Ghostz
65acb94f45
fix: text filed check for 4v request (#1634) 2024-07-13 14:57:08 +08:00
zijiren
6ad169975f
fix: impl cloudflare worker ai gateway (#1617) 2024-07-09 22:57:06 +08:00
Qiying Wang
f636c50c84
fix: duplicate [DONE] (#1629) 2024-07-09 22:43:59 +08:00
Qiying Wang
720fe2dfeb
feat: refactor AwsClaude to Aws to support both llama3 and claude (#1601)
* feat: refactor AwsClaude to Aws to support both llama3 and claude

* fix: aws llama3 ratio
2024-07-06 13:19:41 +08:00
Jason
e090e76c86
feat: add Novita AI as model provider (#1609) 2024-07-06 13:16:46 +08:00
zijiren
efd30a40b3
feat: cloudflare support native openai api (#1596) 2024-07-06 13:12:30 +08:00
Mikey
0fc07ea558
feat: add support for Claude 3 tool use (function calling) (#1587)
* feat: add tool support for AWS & Claude

* fix: add {} for openai compatibility in streaming tool_use
2024-07-02 00:12:01 +08:00
Shi Jilin
c135d74f13
feat: support Spark4.0 Ultra (#1575)
* fix: fix SparkDesk Function Call (修复 Spark Pro/Max函数调用只会返回普通对话回答而不是Function Call回答的问题

* feat: support Spark4.0 Ultra
2024-06-30 19:38:02 +08:00
lihangfu
d0369b114f
feat: support spark4.0 ultra (#1569)
* feat: 支持v3最新协议的腾讯混元(#1452)

* feat: 支持Spark4.0 Ultra

---------

Co-authored-by: lihangfu <hfli8@iflytek.com>
2024-06-30 19:37:07 +08:00
zijiren
b21b3b5b46
refactor: abusing goroutines and channel (#1561)
* refactor: abusing goroutines

* fix: trim data prefix

* refactor: move functions to render package

* refactor: add back trim & flush

---------

Co-authored-by: JustSong <quanpengsong@gmail.com>
2024-06-30 18:36:33 +08:00
shaoyun
ae1cd29f94
feat: added support for Claude Sonnet 3.5 (#1567) 2024-06-30 16:25:25 +08:00
Ghostz
5a58426859
fix minimax empty log (#1560) 2024-06-30 16:09:16 +08:00
Shi Jilin
ff196b75a7
fix: fix sparkdesk function call 2024-06-20 22:56:59 +08:00
lihangfu
279caf82dc
feat: support tencent v3 api (#1542)
Co-authored-by: lihangfu <hfli8@iflytek.com>
2024-06-20 00:23:08 +08:00
Wei Tingjiang
b1520b308b
Try to fix Gemini streaming return being truncated by FinishReason. (#1477)
1
2024-06-14 00:30:47 +08:00
Zhong Liu
c1971870fa
fix: support for Spark Lite model (#1526)
* fix: Support for Spark Lite model

* fix: fix panic

* fix: fix xunfei version config

---------

Co-authored-by: JustSong <39998050+songquanpeng@users.noreply.github.com>
Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-06-13 00:07:26 +08:00
wagxuebing
f83894c83f
fix: xunfei interface call 4001 error (#1499)
Co-authored-by: lynnssb <lynntobing@gmail.com>
2024-06-12 23:12:58 +08:00
fxsome
e9981fff36
feat: post all messages for cloudflare (#1515) 2024-06-08 13:34:23 +08:00
取梦为饮
98669d5d48
feat: add support for bytedance's doubao (#1438)
* 增加豆包大模型支持

* chore: update channel options & add prompt

---------

Co-authored-by: 康龙彪 <longbiao.kang@i-tudou.com>
Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-06-08 13:26:26 +08:00
Wei Tingjiang
9321427c6e
feat: support gemini embeddings (text-embedding-004,embedding-001) (#1475)
* Refactor Gemini Adaptor to Support Embeddings

* Add new models to ModelList
2024-05-29 01:17:32 +08:00
JustSong
ceea4c6d4a feat: support user content download proxy & relay proxy now 2024-05-29 01:14:00 +08:00
Dafei Zhao
a9211d66f6
fix: fix gpt-4o token encoding (#1446) 2024-05-28 01:26:07 +08:00
Qiying Wang
2457d00afb
feat: support gpt-4o (#1431) 2024-05-21 01:14:22 +08:00
JustSong
2720e1a358 feat: support minimax's 6.5 models (close #1395) 2024-04-30 02:23:14 +08:00
JustSong
71f4403fd5 feat: add together.ai support (#1298) 2024-04-30 02:16:53 +08:00
JustSong
7e027d2bd0 fix: fix minimax prompt & completion tokens is empty (#1391) 2024-04-29 22:35:47 +08:00
JustSong
30f373b623 fix: fix usage is empty (close #1391) 2024-04-29 22:29:13 +08:00
caixinjiang
6cffb116b7
fix: fix zhipu embedding error when input is array but not string (#1306)
* fix zhipu embedding error when input is array but not string

* fix: only use the first one

---------

Co-authored-by: 蔡新疆 <cxj@icc.link>
Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-04-27 16:05:14 +08:00
Qiying Wang
a84c7b38b7
fix: claude stream response parse (#1334) 2024-04-27 15:58:07 +08:00
NongMO
6170b91d1c
feat: support for the ollama vision model (#1376)
* feat: support for the ollama vision model

`llava` model, pass test

* Update main.go

format code

* chore: remove useless log

---------

Co-authored-by: nongqiqin <nongqiqin@tipdm.com>
Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-04-27 15:47:27 +08:00
JustSong
04b49aa0ec chore: use StringContent() to convert response to text 2024-04-27 15:41:02 +08:00
Wei Tingjiang
ef88497f25
fix: refactor Gemini adaptor to support streaming content generation (#1382) 2024-04-27 15:39:59 +08:00
JustSong
007906216d feat: support DeepL's model (close #1126) 2024-04-27 13:37:22 +08:00
JustSong
e64e7707a0 feat: support cohere's web search 2024-04-27 00:06:43 +08:00
JustSong
ea210b6ed7 chore: update ollama models 2024-04-26 23:12:39 +08:00
JustSong
9026ec7510 feat: support cloudflare now 2024-04-26 23:05:48 +08:00
JustSong
c317872097 feat: support deepseek now 2024-04-26 00:48:53 +08:00
JustSong
da0842272c fix: add model to response (close #1362) 2024-04-24 22:19:58 +08:00
Ghostz
24f026d18e
feat: add cohere support (#1355)
* support cohere

* chore: tiny improvements

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-04-24 21:50:01 +08:00
Wei Tingjiang
779b747e9e
feat: add function and tools support for Gemini (#1358)
* Update model.go

* Support Gemini tool_calls.

* Fix gemini tool calls (also keep support functions).

* Fixed the problem of arguments not being stringified.

Fix panic: candidate.Content.Parts out of range
2024-04-24 21:26:45 +08:00
JustSong
e30ebda0fe chore: move config key to package ctxkey 2024-04-21 18:55:13 +08:00
JustSong
e5b3e37c46 feat: support bot prefix for coze 2024-04-21 18:04:56 +08:00
JustSong
8de489cf06 feat: support coze now 2024-04-21 17:59:57 +08:00
JustSong
541182102e fix: ignore empty choice response for azure (close #1324) 2024-04-21 16:22:28 +08:00
tylinux
a2a00dfbc3
feat: groq support Llama3 now (#1333)
* feat: groq support Llama3 now

* fix: update model ratio

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-04-21 14:53:03 +08:00
Laisky.Cai
fc9a784950
feat: support aws bedrockruntime claude3 (#1328)
* feat: support aws bedrockruntime claude3

closes #622, closes #749, closes #1300

* fix: convert to aws claude model id

* fix: Update AWS adapter to handle stream completions and calculate usage metrics

Based on the file summaries provided, here are the important bullet points for the commit message:

- Add functionality to handle stream completion events from AWS in the relay/adaptor/aws/main.go file
- Marshall AWS response to OpenAI format and calculate usage metrics in the same file
- Implement a custom render function for streaming events in the same file
- Improve error handling for JSON unmarshalling and marshalling errors in the same file

* fix: Implement AWS handler with usage tracking and error handling

- Implemented streaming response handling for AWS handler
- Set response content type to text/event-stream
- Added error handling for failed marshaling/unmarshaling
- Updated return values to include `relaymodel.ErrorWithStatusCode` and `relaymodel.Usage`
- Improved error handling and response formatting for AWS adaptor

* fix: Refactor AWS Adapter for Improved Model Mapping and Error Handling

* Refactor AWS adapter to improve model management
  - Replace hardcoded model list in `adapter.go` with a function to get models from `awsModelIDMap`
  - Update `GetModelList` function to return model list directly
  - Add `GetChannelName` function to get channel name from `Adaptor` object
* Improve error handling and code organization in main.go
  - Replace switch statement with a map to map AWS model IDs to OpenAI model IDs
  - Return an error if the model is not found in the map
  - Use a single return statement instead of wrapping multiple return statements in the `awsModelID` function
  - Add a new error message for when the model is not found in the map in the `Handler` function

* fix: bug fix

* chore: change variable name & package

* chore: change variable name

* perf: update config related code

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-04-20 00:40:47 +08:00