Skip to content

Commit

Permalink
fix: #198
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk-Gosuto committed Feb 20, 2024
1 parent 6dd0ad6 commit b920027
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/api/langchain/tool/agent/agentapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ export class AgentApi {
const serverConfig = getServerSideConfig();

// const reqBody: RequestBody = await req.json();
const isAzure = reqBody.isAzure || serverConfig.isAzure;
// ui set azure model provider
const isAzure = reqBody.isAzure;
const authHeaderName = isAzure ? "api-key" : "Authorization";
const authToken = req.headers.get(authHeaderName) ?? "";
const token = authToken.trim().replaceAll("Bearer ", "").trim();
Expand Down
5 changes: 5 additions & 0 deletions app/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ function createEmptySession(): ChatSession {
}

function getSummarizeModel(currentModel: string) {
// if the current model does not exist in the default model
// example azure services cannot use SUMMARIZE_MODEL
const model = DEFAULT_MODELS.find((m) => m.name === currentModel);
console.log("model", model);
if (!model) return currentModel;
// if it is using gpt-* models, force to use 3.5 to summarize
return currentModel.startsWith("gpt") ? SUMMARIZE_MODEL : currentModel;
}
Expand Down

0 comments on commit b920027

Please sign in to comment.