diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/Embeddings/EmbeddingCreateResponse.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/Embeddings/EmbeddingCreateResponse.cs index 583ce31e..5d072540 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/Embeddings/EmbeddingCreateResponse.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/Embeddings/EmbeddingCreateResponse.cs @@ -105,6 +105,8 @@ public record EmbeddingCreateResponse : ThorBaseResponse public record EmbeddingResponse { + [JsonPropertyName("object")] public string Object { get; set; } = "embedding"; + [JsonPropertyName("index")] public int? Index { get; set; } [JsonPropertyName("embedding")] public object Embedding { get; set; } diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs index 82f6e188..3206ee64 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs @@ -389,6 +389,7 @@ public class AiGateWayManager : DomainService var usage = new ThorUsageResponse() { + PromptTokens = stream.Usage?.PromptTokens??0, InputTokens = stream.Usage?.InputTokens ?? 0, CompletionTokens = 0, TotalTokens = stream.Usage?.InputTokens ?? 0 @@ -398,7 +399,7 @@ public class AiGateWayManager : DomainService input.Model, stream.Data, stream.Error, - stream.ObjectTypeName, + Object = stream.ObjectTypeName, Usage = usage }); diff --git a/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.json b/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.json index e62f5eab..0df0ce3b 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.json +++ b/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.json @@ -21,7 +21,7 @@ //应用启动 "App": { "SelfUrl": "http://*:19001", - "CorsOrigins": "http://localhost:19001;http://localhost:18000;vscode-file://vscode-app" + "CorsOrigins": "http://localhost:19001;http://localhost:18000;vscode-file://vscode-app;https://web.chatboxai.app" }, //配置 "Settings": {