Provide a new fast and simple way of accessing APIs (As example: Yi-models,Deepseek) #1782
+516
−295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
考虑到新的大语言模型API普遍兼容OpenAI 的API格式(例如: Groq,Yi01,Deepseek,Moonshot等)
这个PR提供了一种更为简单的方式快速添加此类API,仅需要给程序提供:
这是一个使用这种方法添加DeepseekAPI的示范,其仅需修改
config.py
与request_llms/bridge_all.py
两个文件,仅使用33行代码即可添加"deepseek-chat"以及"deepseek-coder"模型。PR包含的其他内容:将零一万物的请求格式也替换为这种格式
同时参考这个issue,留下了对代理的开关参数,或许未来可以自定义?