Skip to content

Commit

Permalink
Merge remote-tracking branch 'gitlab/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/apinto/driver.go
#	app/apinto/profession.go
#	convert/convert.go
#	drivers/ai-provider/converter.go
#	drivers/ai-provider/node.go
#	drivers/ai-provider/openAI/config.go
#	drivers/ai-provider/openAI/executor.go
#	drivers/ai-provider/provider.go
#	drivers/plugins/ai-prompt/executor.go
  • Loading branch information
Dot-Liu committed Oct 28, 2024
2 parents 7d2d7eb + f939d6a commit d7fcbee
Show file tree
Hide file tree
Showing 497 changed files with 27,306 additions and 34 deletions.
1 change: 1 addition & 0 deletions app/apinto/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ apinto*
/.scannerwork/
/config.yml
/tmp_apinto/
/tmp_apipark/
57 changes: 57 additions & 0 deletions app/apinto/driver.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
package main

import (
anthropic "github.com/eolinker/apinto/drivers/ai-provider/authropic"
"github.com/eolinker/apinto/drivers/ai-provider/baichuan"
"github.com/eolinker/apinto/drivers/ai-provider/bedrock"
"github.com/eolinker/apinto/drivers/ai-provider/chatglm"
"github.com/eolinker/apinto/drivers/ai-provider/cohere"
"github.com/eolinker/apinto/drivers/ai-provider/deepseek"
"github.com/eolinker/apinto/drivers/ai-provider/fakegpt"
"github.com/eolinker/apinto/drivers/ai-provider/fireworks"
"github.com/eolinker/apinto/drivers/ai-provider/google"
"github.com/eolinker/apinto/drivers/ai-provider/groq"
"github.com/eolinker/apinto/drivers/ai-provider/hunyuan"
"github.com/eolinker/apinto/drivers/ai-provider/minimax"
"github.com/eolinker/apinto/drivers/ai-provider/mistralai"
"github.com/eolinker/apinto/drivers/ai-provider/moonshot"
"github.com/eolinker/apinto/drivers/ai-provider/novita"
"github.com/eolinker/apinto/drivers/ai-provider/nvidia"
"github.com/eolinker/apinto/drivers/ai-provider/openAI"
"github.com/eolinker/apinto/drivers/ai-provider/openrouter"
"github.com/eolinker/apinto/drivers/ai-provider/perfxcloud"
"github.com/eolinker/apinto/drivers/ai-provider/spark"
"github.com/eolinker/apinto/drivers/ai-provider/stepfun"
"github.com/eolinker/apinto/drivers/ai-provider/tongyi"
"github.com/eolinker/apinto/drivers/ai-provider/upstage"
"github.com/eolinker/apinto/drivers/ai-provider/vertex_ai"
"github.com/eolinker/apinto/drivers/ai-provider/wenxin"
"github.com/eolinker/apinto/drivers/ai-provider/yi"
"github.com/eolinker/apinto/drivers/ai-provider/zhinao"
"github.com/eolinker/apinto/drivers/ai-provider/zhipuai"
"github.com/eolinker/apinto/drivers/certs"
"github.com/eolinker/apinto/drivers/discovery/consul"
"github.com/eolinker/apinto/drivers/discovery/eureka"
Expand Down Expand Up @@ -86,4 +113,34 @@ func driverRegister(extenderRegister eosc.IExtenderDriverRegister) {

// AI供应商
openAI.Register(extenderRegister)

google.Register(extenderRegister)
moonshot.Register(extenderRegister)
tongyi.Register(extenderRegister)
zhipuai.Register(extenderRegister)
fireworks.Register(extenderRegister)
novita.Register(extenderRegister)
mistralai.Register(extenderRegister)

anthropic.Register(extenderRegister)

baichuan.Register(extenderRegister)
stepfun.Register(extenderRegister)
wenxin.Register(extenderRegister)
yi.Register(extenderRegister)
perfxcloud.Register(extenderRegister)
cohere.Register(extenderRegister)
deepseek.Register(extenderRegister)
hunyuan.Register(extenderRegister)
openrouter.Register(extenderRegister)
groq.Register(extenderRegister)
upstage.Register(extenderRegister)
minimax.Register(extenderRegister)
chatglm.Register(extenderRegister)
bedrock.Register(extenderRegister)
spark.Register(extenderRegister)
nvidia.Register(extenderRegister)
vertex_ai.Register(extenderRegister)
fakegpt.Register(extenderRegister)
zhinao.Register(extenderRegister)
}
161 changes: 161 additions & 0 deletions app/apinto/profession.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,167 @@ func ApintoProfession() []*eosc.ProfessionConfig {
Label: "openAI",
Desc: "openAI",
},
{
Id: "eolinker.com:apinto:google", // 插件ID
Name: "google", // 驱动名称,应和定义文件的provider字段一致
Label: "Google",
Desc: "Google",
},
{
Id: "eolinker.com:apinto:moonshot", // 插件ID
Name: "moonshot", // 驱动名称,应和定义文件的provider字段一致
Label: "moonshot",
Desc: "moonshot",
},
{
Id: "eolinker.com:apinto:tongyi", // 插件ID
Name: "tongyi", // 驱动名称,应和定义文件的provider字段一致
Label: "tongyi",
Desc: "tongyi",
},
{
Id: "eolinker.com:apinto:zhipuai", // 插件ID
Name: "zhipuai", // 驱动名称,应和定义文件的provider字段一致
Label: "zhipuai",
Desc: "zhipuai",
},
{
Id: "eolinker.com:apinto:fireworks", // 插件ID
Name: "fireworks", // 驱动名称,应和定义文件的provider字段一致
Label: "fireworks",
Desc: "fireworks",
},
{
Id: "eolinker.com:apinto:novita", // 插件ID
Name: "novita", // 驱动名称,应和定义文件的provider字段一致
Label: "novita",
Desc: "novita",
},
{
Id: "eolinker.com:apinto:mistralai", // 插件ID
Name: "mistralai", // 驱动名称,应和定义文件的provider字段一致
Label: "mistralai",
Desc: "mistralai",
},
{
Id: "eolinker.com:apinto:anthropic", // 插件ID
Name: "anthropic", // 驱动名称,应和定义文件的provider字段一致
Label: "Anthropic",
Desc: "Anthropic",
},
{
Id: "eolinker.com:apinto:baichuan", // 插件ID
Name: "baichuan", // 驱动名称,应和定义文件的provider字段一致
Label: "Baichuan",
Desc: "Baichuan",
},
{
Id: "eolinker.com:apinto:stepfun", // 插件ID
Name: "stepfun", // 驱动名称,应和定义文件的provider字段一致
Label: "Stepfun",
Desc: "Stepfun",
},
{
Id: "eolinker.com:apinto:wenxin", // 插件ID
Name: "wenxin", // 驱动名称,应和定义文件的provider字段一致
Label: "Wenxin",
Desc: "Wenxin",
},
{
Id: "eolinker.com:apinto:yi", // 插件ID
Name: "yi", // 驱动名称,应和定义文件的provider字段一致
Label: "yi",
Desc: "yi",
},
{
Id: "eolinker.com:apinto:perfxcloud", // 插件ID
Name: "perfxcloud", // 驱动名称,应和定义文件的provider字段一致
Label: "Perfxcloud",
Desc: "Perfxcloud",
},
{
Id: "eolinker.com:apinto:cohere", // 插件ID
Name: "cohere", // 驱动名称,应和定义文件的provider字段一致
Label: "Cohere",
Desc: "Cohere",
},
{
Id: "eolinker.com:apinto:deepseek", // 插件ID
Name: "deepseek", // 驱动名称,应和定义文件的provider字段一致
Label: "Deepseek",
Desc: "Deepseek",
},
{
Id: "eolinker.com:apinto:hunyuan", // 插件ID
Name: "hunyuan", // 驱动名称,应和定义文件的provider字段一致
Label: "Hunyuan",
Desc: "Hunyuan",
},
{
Id: "eolinker.com:apinto:openrouter", // 插件ID
Name: "openrouter", // 驱动名称,应和定义文件的provider字段一致
Label: "OpenRouter",
Desc: "OpenRouter",
},
{
Id: "eolinker.com:apinto:groq", // 插件ID
Name: "groq", // 驱动名称,应和定义文件的provider字段一致
Label: "GroqCloud",
Desc: "GroqCloud",
},
{
Id: "eolinker.com:apinto:upstage", // 插件ID
Name: "upstage", // 驱动名称,应和定义文件的provider字段一致
Label: "upstage",
Desc: "upstage",
},
{
Id: "eolinker.com:apinto:minimax", // 插件ID
Name: "minimax", // 驱动名称,应和定义文件的provider字段一致
Label: "minimax",
Desc: "minimax",
},
{
Id: "eolinker.com:apinto:chatglm", // 插件ID
Name: "chatglm", // 驱动名称,应和定义文件的provider字段一致
Label: "chatglm",
Desc: "chatglm",
},
{
Id: "eolinker.com:apinto:bedrock", // 插件ID
Name: "bedrock", // 驱动名称,应和定义文件的provider字段一致
Label: "AWS Bedrock",
Desc: "AWS Bedrock",
},
{
Id: "eolinker.com:apinto:spark", // 插件ID
Name: "spark", // 驱动名称,应和定义文件的provider字段一致
Label: "讯飞星火",
Desc: "讯飞星火",
},
{
Id: "eolinker.com:apinto:nvidia", // 插件ID
Name: "nvidia", // 驱动名称,应和定义文件的provider字段一致
Label: "Nvidia",
Desc: "Nvidia",
},
{
Id: "eolinker.com:apinto:vertex_ai", // 插件ID
Name: "vertex_ai", // 驱动名称,应和定义文件的provider字段一致
Label: "Vertex AI",
Desc: "Vertex AI",
},
{
Id: "eolinker.com:apinto:fakegpt", // 插件ID
Name: "fakegpt", // 驱动名称,应和定义文件的provider字段一致
Label: "Fake GPT",
Desc: "Fake GPT",
},{
, Id: "eolinker.com:apinto:zhinao", // 插件ID
Name: "zhinao", // 驱动名称,应和定义文件的provider字段一致
Label: "zhinao",
Desc: "zhinao",
},
},
Mod: eosc.ProfessionConfig_Worker,
},
Expand Down
5 changes: 5 additions & 0 deletions convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ type IConverter interface {
RequestConvert(ctx eocontext.EoContext, extender map[string]interface{}) error
ResponseConvert(ctx eocontext.EoContext) error
}

type IChildConverter interface {
IConverter
Endpoint() string
}
type FGenerateConfig func(cfg string) (map[string]interface{}, error)

func CheckSkill(skill string) bool {
Expand Down
39 changes: 39 additions & 0 deletions drivers/ai-provider/authropic/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package anthropic

import (
"fmt"
"net/url"

"github.com/eolinker/eosc"
)

const defaultVersion = "2023-06-01"

type Config struct {
APIKey string `json:"anthropic_api_key"`
Base string `json:"anthropic_api_url"`
Version string `json:"anthropic_api_version"`
}

func checkConfig(v interface{}) (*Config, error) {
conf, ok := v.(*Config)
if !ok {
return nil, eosc.ErrorConfigType
}
if conf.APIKey == "" {
return nil, fmt.Errorf("api_key is required")
}
if conf.Base != "" {
u, err := url.Parse(conf.Base)
if err != nil {
return nil, fmt.Errorf("base url is invalid")
}
if u.Scheme == "" || u.Host == "" {
return nil, fmt.Errorf("base url is invalid")
}
}
if conf.Version == "" {
conf.Version = defaultVersion
}
return conf, nil
}
Loading

0 comments on commit d7fcbee

Please sign in to comment.