Senparc / Senparc.AI

Senparc 全家桶的 AI 扩展包
Apache License 2.0
63 stars 25 forks source link

增加支持OpenAI的接口地址代理 #19

Open hnsongbiao opened 1 year ago

hnsongbiao commented 1 year ago
`{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Warning"
    }
  },
  //CO2NET 设置
  "SenparcSetting": {
    "IsDebug": true,
    "DefaultCacheNamespace": "DefaultCacheTest"
  },
  //Senparc.AI 设置
  "SenparcAiSetting": {
    "IsDebug": true,
    "AiPlatform": "AzureOpenAI",
    "AzureOpenAIKeys": {
      "ApiKey": "YourAzureApiKey", //TODO:加密
      "AzureEndpoint": `"https://xxxx.openai.azure.com/",`
      "AzureOpenAIApiVersion": "2022-12-01" //调用限制请参考:https://learn.microsoft.com/en-us/azure/cognitive-services/openai/quotas-limits
    },
    "OpenAIKeys": {
      "ApiKey": "YourOpenAIKey", //TODO:加密
      "OrgaizationId": "YourOpenAIOrgId"
    }
  }
}

OpenAIKeys里建议增加OpenAI接口地址的代理设置,可以使用云函数做一个代理地址,解决网络访问问题

JeffreySu commented 11 months ago

@hnsongbiao 尝试添加了,但是似乎在 SematicKernel 中提供的 OpenAI 的注册方法并不能改写这个参数?我的理解是其实如果要自定义,只要使用 AzureOpenAIKeys 进行设置就行了?

新的代码已经在一个独立分支中:https://github.com/Senparc/Senparc.AI/tree/feature/19-AddOpenAIEndpoint