Skip to content

Commit

Permalink
feat: optimize getHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogtiti committed Jul 6, 2024
1 parent b58bbf8 commit 700b06f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export class ClientApi {

export function getHeaders() {
const accessStore = useAccessStore.getState();
const chatStore = useChatStore.getState();
const headers: Record<string, string> = {
"Content-Type": "application/json",
Accept: "application/json",
Expand All @@ -165,8 +166,7 @@ export function getHeaders() {
const clientConfig = getClientConfig();

function getConfig() {
const modelConfig = useChatStore.getState().currentSession()
.mask.modelConfig;
const modelConfig = chatStore.currentSession().mask.modelConfig;
const isGoogle = modelConfig.providerName == ServiceProvider.Google;
const isAzure = modelConfig.providerName === ServiceProvider.Azure;
const isAnthropic = modelConfig.providerName === ServiceProvider.Anthropic;
Expand Down

0 comments on commit 700b06f

Please sign in to comment.