setup max retries for AI request
This commit is contained in:
@@ -22,6 +22,7 @@ export const analyzeCommand = async (
|
||||
},
|
||||
cache: false,
|
||||
verbose: true,
|
||||
maxRetries: 2,
|
||||
});
|
||||
|
||||
const prompt = ChatPromptTemplate.fromMessages([
|
||||
|
||||
@@ -39,6 +39,7 @@ export const extractStoryCommand = async (
|
||||
},
|
||||
cache: true,
|
||||
verbose: true,
|
||||
maxRetries: 2,
|
||||
}).bind({
|
||||
tools: [
|
||||
{
|
||||
|
||||
@@ -59,6 +59,7 @@ export const ipaCommand = async (
|
||||
},
|
||||
cache: true,
|
||||
verbose: true,
|
||||
maxRetries: 2,
|
||||
});
|
||||
|
||||
const prompt = ChatPromptTemplate.fromMessages([
|
||||
|
||||
@@ -71,6 +71,7 @@ export const lookupCommand = async (
|
||||
},
|
||||
cache: true,
|
||||
verbose: true,
|
||||
maxRetries: 2,
|
||||
});
|
||||
|
||||
const prompt = ChatPromptTemplate.fromMessages([
|
||||
|
||||
@@ -22,6 +22,7 @@ export const translateCommand = async (
|
||||
},
|
||||
cache: false,
|
||||
verbose: true,
|
||||
maxRetries: 2,
|
||||
});
|
||||
|
||||
const prompt = ChatPromptTemplate.fromMessages([
|
||||
|
||||
@@ -39,7 +39,7 @@ export const useConversation = () => {
|
||||
configuration: {
|
||||
baseURL: `${apiUrl}/api/ai`,
|
||||
},
|
||||
maxRetries: 3,
|
||||
maxRetries: 2,
|
||||
modelName: model,
|
||||
temperature,
|
||||
maxTokens,
|
||||
@@ -55,6 +55,7 @@ export const useConversation = () => {
|
||||
configuration: {
|
||||
baseURL: baseUrl || openai.baseUrl,
|
||||
},
|
||||
maxRetries: 2,
|
||||
modelName: model,
|
||||
temperature,
|
||||
maxTokens,
|
||||
@@ -69,6 +70,7 @@ export const useConversation = () => {
|
||||
temperature,
|
||||
frequencyPenalty,
|
||||
presencePenalty,
|
||||
maxRetries: 2,
|
||||
});
|
||||
} else if (conversation.engine === "googleGenerativeAi") {
|
||||
if (!googleGenerativeAi) throw new Error("Google Generative AI API key is required");
|
||||
@@ -78,6 +80,7 @@ export const useConversation = () => {
|
||||
modelName: model,
|
||||
temperature: temperature,
|
||||
maxOutputTokens: maxTokens,
|
||||
maxRetries: 2,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user