Skip to content

Commit

Permalink
Feat/modelhub (#1) (#2)
Browse files Browse the repository at this point in the history
* feat: translations (langgenius#3176)

* fix: prompt editor variable picker (langgenius#3177)

* Fix: features of agent-chat (langgenius#3178)

* version to 0.6.0-fix1 (langgenius#3179)

* fix keyword index error when storage source is S3 (langgenius#3182)

* Update README.md to include workflows (langgenius#3180)

* Compatible with unique index conflicts (langgenius#3183)

* fix: sometimes chosed old selected knowledge may overwirte the new knowledge (langgenius#3199)

* Fix: remove unavailable return_preamble parameter in cohere (langgenius#3201)



* Fix/code transform result (langgenius#3203)

* fix(code_executor): surrogates not allowed error in jinja2 template (langgenius#3191)

* fix: node connect self (langgenius#3194)

* Update README.md (langgenius#3206)

* fix economy index search in workflow (langgenius#3205)

* fix: index number in api/README (langgenius#3214)

* Update README.md (langgenius#3212)

* fix detached instance error in keyword index create thread and fix question classifier node out of index error (langgenius#3219)

* fix: incomplete response (langgenius#3215)

* fix: latest image tag not push in GitHub action (langgenius#3213)

* fix: vision config doesn't enabled in llm (langgenius#3225)

* fixed the issue of missing cleanup function in the AudioBtn component (langgenius#3133)

* fix: image text when retrieve chat histories (langgenius#3220)

* feat: moonshot function call (langgenius#3227)

* feat: support setting database used in Milvus (langgenius#3003)

* fix milvus database name parameter missed (langgenius#3229)

* fix: file not uploaded caused api error (langgenius#3228)

* update link (langgenius#3226)

* fix: skip Celery warning by setting broker_connection_retry_on_startup config (langgenius#3188)

* fix: workflow run edge status (langgenius#3236)

* fix: empty conversation list of explore chatbot (langgenius#3235)

* Fix: picture of workflow (langgenius#3241)

* feat: prompt-editor support undo (langgenius#3242)

* fix: number type in app would render as select type in webapp (langgenius#3244)

* fix: token is not logging of question classifier node (langgenius#3249)

* chore: remove langchain in tools (langgenius#3247)

* make sure validation flow works for all model providers in bedrock (langgenius#3250)

* feat: remove unregistered-llm-in-debug (langgenius#3251)

* version to 0.6.1 (langgenius#3253)

* fix: agent chat multiple model debug (langgenius#3258)

* feat: gpt-4-turbo (langgenius#3263)

* fix: image was sent to an unsupported LLM when sending second message (langgenius#3268)

* feat: vision parameter support of OpenAI Compatible API (langgenius#3272)

* fix: var assigner input node can not find caused error (langgenius#3274)

* fix: variable-assigner node connect (langgenius#3288)

* Feat/Agent-Image-Processing (langgenius#3293)



* chore: address security alerts on braces escape and KaTeX (langgenius#3301)

* chore(deps): bump katex from 0.16.8 to 0.16.10 in /web (langgenius#3307)




* Update README.md (langgenius#3281)

* Remove langchain dataset retrival agent logic (langgenius#3311)

* add german translations (langgenius#3322)

* feat: add missing workflow i18n keys (langgenius#3309)



* feat:add 'name' field return (langgenius#3152)

* improvement: speed up dependency installation in docker image rebuilds by mounting cache layer (langgenius#3218)

* feat: support gpt-4-turbo-2024-04-09 model (langgenius#3300)

* feat: Add Cohere Command R / R+ model support (langgenius#3333)

* fix dataset retrival in dataset mode (langgenius#3334)

* chore:bump pypdfium2 from 4.16.0 to 4.17.0 (langgenius#3310)

* feat(llm/models): add gemini-1.5-pro (langgenius#2925)

* feat: make input size bigger in start (langgenius#3340)

* Doc/update readme (langgenius#3344)

* fix: leave  progress page still call indexing-status api (langgenius#3345)

* feat: update aws bedrock (langgenius#3326)



* fix/moonshot-function-call (langgenius#3339)

* fix issue: user’s keywords do not affect when add segment (langgenius#3349)

* add segment with keyword issue (langgenius#3351)



* Fix issue : don't delete DatasetProcessRule, DatasetQuery and AppDatasetJoin when delete dataset with no document (langgenius#3354)

* fix: remove middle editor may cause render placement error (langgenius#3356)

* Added a note on the front-end docker build: use taobao source to accelerate the installation of front-end dependency packages to achieve the purpose of quickly building containers (langgenius#3358)




* fix: var name too long would break ui in var assigner and end nodes (langgenius#3361)

* Refactor/react agent (langgenius#3355)

* Fix/Bing Search url endpoint cannot be customized (langgenius#3366)

* fix: image token calc of OpenAI Compatible API (langgenius#3368)

* Update README.md (langgenius#3371)

* update workflow intro mp4 codec (langgenius#3372)

* fix: cohere tool call does not support single tool (langgenius#3373)

* version to 0.6.2 (langgenius#3375)

* fix: variable pool mapping variable mixed up (langgenius#3378)

* version to 0.6.2-fix1 (langgenius#3380)

* fix: yarn install extract package err when using GitHub Cache in amd6… (langgenius#3383)

* feat: Add support for embed file with AWS Bedrock Titan Model (langgenius#3377)



* fix: remove - in dataset retriever tool name (langgenius#3381)

* feat:api Add support for extracting EPUB files in ExtractProcessor (langgenius#3254)



* feat: show citation info in run history (langgenius#3399)

* Feat: Invitation link automatically completes domain name (langgenius#3393)



* Integrated SearXNG search as built-in tool (langgenius#3363)



* fix: [azure_openai] Error: 'NoneType' object has no attribute 'content' (langgenius#3389)

* Update providers preview (langgenius#3403)

* add xls file suport (langgenius#3321)

* Update README.md (langgenius#3405)

* Fix/workflow tool incorrect parameter configurations (langgenius#3402)



* chore: replace all set interval (langgenius#3411)

* feat: Deprecate datetime.utcnow() in favor of datetime.now(timezone.utc).replace(tzinfo=None) for better timezone handling (langgenius#3408) (langgenius#3416)

* chore: remove Langchain tools import (langgenius#3407)

* feat: gemini pro function call (langgenius#3406)

* fix: shared text-generation stream (langgenius#3419)

* fix/dataset-retriever-tool-parameter-redundancy (langgenius#3418)

* Feat/api tool custom timeout (langgenius#3420)

* fix: test env key missing or wrong (langgenius#3430)

* Doc/update readme (langgenius#3433)

* Update README_CN.md (langgenius#3434)

* Update README_CN.md (langgenius#3435)

* feat: add workflow editor shortcuts (langgenius#3382) (langgenius#3390)

* FEAT: cohere rerank 3 model added (langgenius#3431)

* chore: remove the COPY instruction in .devcontainer/Dockerfile (langgenius#3409)

* fix typo: Changlog -> Changelog (langgenius#3442)

* fix: node shortcuts active in input fields (langgenius#3438)

* Add nvidia codegemma 7b (langgenius#3437)

* Update yaml and py file in Tavily Tool (langgenius#3450)

* feat: Added the mirror of Aliyun's Linux apk installation package and updated the deprecated taobao npm mirror address to npmmirror (langgenius#3459)

* Revert "Update yaml and py file in Tavily Tool" (langgenius#3464)

* feat: jina reader (langgenius#3468)

* feat: support configurate openai compatible stream tool call (langgenius#3467)

* feat: optimize the efficiency of generating chatbot conversation name (langgenius#3472)

* feat: remove langchain from output parsers (langgenius#3473)

* chore: separate Python dependencies for development (langgenius#3198)

* chore: add sandbox permission tooltip (langgenius#3477)

* fix: prompt template issue (langgenius#3449)

* feat: support relyt vector database  (langgenius#3367)



* Update README.md (langgenius#3478)

* nvidia-label-update (langgenius#3482)

* fix: in conversation log click op button would cause close drawer (langgenius#3483)

* fix: workflow auto layout nodes offset & delete node shortcuts (langgenius#3484)

* fix: workflow edge curvature (langgenius#3488)

* fix: stringify object while exporting batch result to csv (langgenius#3481)

* question classifier prompt optimization (langgenius#3479)

* feat: refactor tongyi models (langgenius#3496)

* fix: bump twilio to 9.0.4 skipping yanked versions (langgenius#3500)

* test: install ffmpeg for pytests (langgenius#3499)

* feat: support var auto rename in prompt editor (langgenius#3510)

* fix: add message caused problem after simple chat convert to workflow (langgenius#3511)

* fix: the object field is empty string in some openAI api compatible model (langgenius#3506)

* Add suuport for AWS  Bedrock Cohere embedding (langgenius#3444)

* fix: add completion mode object check (langgenius#3515)

* get config default for sandbox (langgenius#3508)



* chore: improve reference variable picker user experience (langgenius#3517)

* fix: array[string] context in llm node invalid (langgenius#3518)

* version to 0.6.3 (langgenius#3519)

* fix the return with wrong datatype of segment (langgenius#3525)

* fix: the hover style of the card-item operation button container (langgenius#3520)

* chore: lint .env file templates (langgenius#3507)

* add support for swagger object type (langgenius#3426)



* /fix register

* /add modelhub

* localhost

* /fix req bugs

* modelhub add rerank

---------

Signed-off-by: Jat <jat@sinosky.org>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: KVOJJJin <jzongcode@gmail.com>
Co-authored-by: takatost <takatost@users.noreply.github.com>
Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com>
Co-authored-by: Chenhe Gu <guchenhe@gmail.com>
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: Jat <jat@sinosky.org>
Co-authored-by: Yeuoly <45712896+Yeuoly@users.noreply.github.com>
Co-authored-by: Eric Wang <wrqatw@gmail.com>
Co-authored-by: Bowen Liang <liangbowen@gf.com.cn>
Co-authored-by: legao <837937787@qq.com>
Co-authored-by: Leo Q <LeoQuote@users.noreply.github.com>
Co-authored-by: minakokojima <lychees67@gmail.com>
Co-authored-by: Nite Knite <nkCoding@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lao <khazzz1c@gmail.com>
Co-authored-by: lbm21 <313338264@qq.com>
Co-authored-by: 呆萌闷油瓶 <253605712@qq.com>
Co-authored-by: Kenny <kt.tian@gmail.com>
Co-authored-by: akou <beiming1201@gmail.com>
Co-authored-by: longzhihun <38651850@qq.com>
Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
Co-authored-by: crazywoola <427733928@qq.com>
Co-authored-by: Moonlit <bc.h@foxmail.com>
Co-authored-by: huangbaichao <hbc@moonlit.art>
Co-authored-by: junytang <junytang@gmail.com>
Co-authored-by: saga.rey <saga.rey@outlook.com>
Co-authored-by: chenxu9741 <1309095142@qq.com>
Co-authored-by: LIU HONGWEI <1327374483@qq.com>
Co-authored-by: Pascal M <11357019+perzeuss@users.noreply.github.com>
Co-authored-by: Yash Parmar <82636823+Yash-1511@users.noreply.github.com>
Co-authored-by: Bodhi <3882561+BodhiHu@users.noreply.github.com>
Co-authored-by: Selene29 <funmailfach@web.de>
Co-authored-by: Josh Feng <noisywolf@gmail.com>
Co-authored-by: Richards Tu <142148415+richards199999@users.noreply.github.com>
Co-authored-by: YidaHu <huyidada@gmail.com>
Co-authored-by: Jingpan Xiong <71321890+klaus-xiong@users.noreply.github.com>
Co-authored-by: jingsi <jingsi@leadincloud.com>
Co-authored-by: Joshua <138381132+joshua20231026@users.noreply.github.com>
Co-authored-by: sino <sino2322@gmail.com>
Co-authored-by: liuzhenghua <1090179900@qq.com>
Co-authored-by: kerlion <40377268+kerlion@users.noreply.github.com>
Co-authored-by: miendinh <22139872+miendinh@users.noreply.github.com>
Co-authored-by: miendinh <miendinh@users.noreply.github.com>
Co-authored-by: buu <bushuai@yahoo.com>
Co-authored-by: LeePui <444561897@qq.com>
Co-authored-by: lipeikui <lipeikui@3vjia.com>
  • Loading branch information
Show file tree
Hide file tree
Showing 30 changed files with 2,399 additions and 465 deletions.
405 changes: 274 additions & 131 deletions api/commands.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion api/core/model_runtime/model_providers/_position.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- modelhub
- openai_api_compatible
- openai
- anthropic
- azure_openai
Expand Down Expand Up @@ -26,4 +28,3 @@
- yi
- openllm
- localai
- openai_api_compatible
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions api/core/model_runtime/model_providers/modelhub/_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

import requests

from core.model_runtime.errors.invoke import (
InvokeAuthorizationError,
InvokeBadRequestError,
InvokeConnectionError,
InvokeError,
InvokeRateLimitError,
InvokeServerUnavailableError,
)


class _CommonOAI_API_Compat:
@property
def _invoke_error_mapping(self) -> dict[type[InvokeError], list[type[Exception]]]:
"""
Map model invoke error to unified error
The key is the error type thrown to the caller
The value is the error type thrown by the model,
which needs to be converted into a unified error type for the caller.
:return: Invoke error mapping
"""
return {
InvokeAuthorizationError: [
requests.exceptions.InvalidHeader, # Missing or Invalid API Key
],
InvokeBadRequestError: [
requests.exceptions.HTTPError, # Invalid Endpoint URL or model name
requests.exceptions.InvalidURL, # Misconfigured request or other API error
],
InvokeRateLimitError: [
requests.exceptions.RetryError # Too many requests sent in a short period of time
],
InvokeServerUnavailableError: [
requests.exceptions.ConnectionError, # Engine Overloaded
requests.exceptions.HTTPError # Server Error
],
InvokeConnectionError: [
requests.exceptions.ConnectTimeout, # Timeout
requests.exceptions.ReadTimeout # Timeout
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
model: Baichuan2-Turbo
label:
zh_Hans: Baichuan2-Turbo
en_US: Baichuan2-Turbo
model_type: llm
features:
- multi-tool-call
- agent-thought
- stream-tool-call
model_properties:
mode: chat
context_size: 8192
parameter_rules:
- name: temperature
use_template: temperature
- name: top_p
use_template: top_p
- name: max_tokens
use_template: max_tokens
default: 512
min: 1
max: 8192
pricing:
input: "0.003"
output: "0.004"
unit: "0.001"
currency: USD
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- gpt-3.5-turbo
- gpt-4
- glm-3-turbo
- glm-4
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
model: glm-3-turbo
label:
zh_Hans: glm-3-turbo
en_US: glm-3-turbo
model_type: llm
features:
- multi-tool-call
- agent-thought
- stream-tool-call
model_properties:
mode: chat
context_size: 8192
parameter_rules:
- name: temperature
use_template: temperature
default: 0.01
pricing:
input: "0.003"
output: "0.004"
unit: "0.001"
currency: USD
21 changes: 21 additions & 0 deletions api/core/model_runtime/model_providers/modelhub/llm/glm-4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
model: glm-4
label:
zh_Hans: glm-4
en_US: glm-4
model_type: llm
features:
- multi-tool-call
- agent-thought
- stream-tool-call
model_properties:
mode: chat
context_size: 8192
parameter_rules:
- name: temperature
use_template: temperature
default: 0.01
pricing:
input: "0.003"
output: "0.004"
unit: "0.001"
currency: USD
Loading

0 comments on commit aaad135

Please sign in to comment.