forked from phoenix/litellm-mirror
fix - set retry policy on ui
This commit is contained in:
parent
4fdf1147d3
commit
eb5dc38fc9
1 changed files with 15 additions and 8 deletions
|
@ -60,6 +60,10 @@ interface EditModelModalProps {
|
||||||
onSubmit: (data: FormData) => void; // Assuming FormData is the type of data to be submitted
|
onSubmit: (data: FormData) => void; // Assuming FormData is the type of data to be submitted
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface RetryPolicyObject {
|
||||||
|
[key: string]: { [retryPolicyKey: string]: number } | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
//["OpenAI", "Azure OpenAI", "Anthropic", "Gemini (Google AI Studio)", "Amazon Bedrock", "OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)"]
|
//["OpenAI", "Azure OpenAI", "Anthropic", "Gemini (Google AI Studio)", "Amazon Bedrock", "OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)"]
|
||||||
|
|
||||||
enum Providers {
|
enum Providers {
|
||||||
|
@ -222,7 +226,7 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
|
||||||
to: new Date(),
|
to: new Date(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const [modelGroupRetryPolicy, setModelGroupRetryPolicy] = useState<Record<string, number>>({});
|
const [modelGroupRetryPolicy, setModelGroupRetryPolicy] = useState<RetryPolicyObject | null>(null);
|
||||||
const [defaultRetry, setDefaultRetry] = useState<number>(0);
|
const [defaultRetry, setDefaultRetry] = useState<number>(0);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1301,7 +1305,7 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||||
<tbody>
|
<tbody>
|
||||||
{Object.entries(retry_policy_map).map(([exceptionType, retryPolicyKey], idx) => {
|
{Object.entries(retry_policy_map).map(([exceptionType, retryPolicyKey], idx) => {
|
||||||
|
|
||||||
let retryCount = modelGroupRetryPolicy?.[selectedModelGroup]?.[retryPolicyKey]
|
let retryCount = modelGroupRetryPolicy?.[selectedModelGroup!]?.[retryPolicyKey]
|
||||||
if (retryCount == null) {
|
if (retryCount == null) {
|
||||||
retryCount = defaultRetry;
|
retryCount = defaultRetry;
|
||||||
}
|
}
|
||||||
|
@ -1318,12 +1322,15 @@ const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||||
min={0}
|
min={0}
|
||||||
step={1}
|
step={1}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
setModelGroupRetryPolicy({
|
setModelGroupRetryPolicy(prevModelGroupRetryPolicy => {
|
||||||
...modelGroupRetryPolicy,
|
const prevRetryPolicy = prevModelGroupRetryPolicy?.[selectedModelGroup!] ?? {};
|
||||||
[selectedModelGroup]: {
|
return {
|
||||||
...modelGroupRetryPolicy[selectedModelGroup],
|
...prevModelGroupRetryPolicy ?? {},
|
||||||
[retryPolicyKey]: value,
|
[selectedModelGroup!]: {
|
||||||
},
|
...prevRetryPolicy,
|
||||||
|
[retryPolicyKey!]: value,
|
||||||
|
},
|
||||||
|
} as RetryPolicyObject;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue