mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 00:32:35 +10:00
feat(openai): add Azure OpenAI support with configuration options
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
|
||||
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL } from "../constants/llm";
|
||||
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL, DEFAULT_AZURE_API_VERSION } from "../constants/llm";
|
||||
|
||||
type OpenAIStore = {
|
||||
baseURL: string | null;
|
||||
@ -12,6 +12,10 @@ type OpenAIStore = {
|
||||
setModel: (model: string | null) => void;
|
||||
maxTokens: number | null;
|
||||
setMaxTokens: (maxTokens: number | null) => void;
|
||||
isAzure: boolean;
|
||||
setIsAzure: (isAzure: boolean) => void;
|
||||
azureApiVersion: string | null;
|
||||
setAzureApiVersion: (apiVersion: string | null) => void;
|
||||
};
|
||||
|
||||
export const useOpenAiStore = create<OpenAIStore>()(
|
||||
@ -33,6 +37,14 @@ export const useOpenAiStore = create<OpenAIStore>()(
|
||||
setMaxTokens: (maxTokens: number | null) => {
|
||||
set({ maxTokens });
|
||||
},
|
||||
isAzure: false,
|
||||
setIsAzure: (isAzure: boolean) => {
|
||||
set({ isAzure });
|
||||
},
|
||||
azureApiVersion: DEFAULT_AZURE_API_VERSION,
|
||||
setAzureApiVersion: (azureApiVersion: string | null) => {
|
||||
set({ azureApiVersion });
|
||||
},
|
||||
}),
|
||||
{ name: "openai" },
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user