Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";

import { buildProviderUpdatePayload } from "@/app/workspace/providers/views/utils";
import { Button } from "@/components/ui/button";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
import { Switch } from "@/components/ui/switch";
import { getErrorMessage, setProviderFormDirtyState, useAppDispatch } from "@/lib/store";
import { useUpdateProviderMutation } from "@/lib/store/apis/providersApi";
import { ModelProvider } from "@/lib/types/config";
import { buildProviderUpdatePayload } from "@/app/workspace/providers/views/utils";
import { openaiConfigFormSchema, type OpenAIConfigFormSchema } from "@/lib/types/schemas";
import { RbacOperation, RbacResource, useRbac } from "@enterprise/lib";
import { zodResolver } from "@hookform/resolvers/zod";
Expand Down Expand Up @@ -72,9 +72,9 @@ export function OpenAIConfigFormFragment({ provider }: OpenAIConfigFormFragmentP
<div className="space-y-0.5">
<FormLabel>Disable Store</FormLabel>
<p className="text-muted-foreground text-xs">
With the Responses API, store defaults to true, and when it is on, the generated response is stored for later retrieval via API. OpenAI
exposes endpoints to retrieve and delete stored responses, so your response IDs become durable server-side objects instead of one-shot
IDs.
With the Responses API, store defaults to true, and when it is on, the generated response is stored for later
retrieval via API. OpenAI exposes endpoints to retrieve and delete stored responses, so your response IDs become
durable server-side objects instead of one-shot IDs.
</p>
</div>
<FormControl>
Expand Down
1 change: 1 addition & 0 deletions ui/app/workspace/providers/views/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export const buildProviderUpdatePayload = (provider: ModelProvider, updates: Par
send_back_raw_response: updates.send_back_raw_response ?? provider.send_back_raw_response,
store_raw_request_response: updates.store_raw_request_response ?? provider.store_raw_request_response,
custom_provider_config: updates.custom_provider_config ?? provider.custom_provider_config,
openai_config: updates.openai_config ?? provider.openai_config,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
};
};
16 changes: 9 additions & 7 deletions ui/lib/types/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,13 @@ export const proxyFormConfigSchema = z
},
);

// OpenAI Config tab
export const openaiConfigFormSchema = z.object({
disable_store: z.boolean(),
});

export type OpenAIConfigFormSchema = z.infer<typeof openaiConfigFormSchema>;

// Allowed requests schema
export const allowedRequestsSchema = z.object({
text_completion: z.boolean(),
Expand Down Expand Up @@ -523,6 +530,7 @@ export const addProviderRequestSchema = z.object({
send_back_raw_response: z.boolean().optional(),
store_raw_request_response: z.boolean().optional(),
custom_provider_config: customProviderConfigSchema.optional(),
openai_config: openaiConfigFormSchema.optional(),
});

// Update provider request schema
Expand All @@ -535,6 +543,7 @@ export const updateProviderRequestSchema = z.object({
send_back_raw_response: z.boolean().optional(),
store_raw_request_response: z.boolean().optional(),
custom_provider_config: customProviderConfigSchema.optional(),
openai_config: openaiConfigFormSchema.optional(),
});

// Cache config schema
Expand Down Expand Up @@ -640,13 +649,6 @@ export const betaHeadersFormSchema = z.object({

export type BetaHeadersFormSchema = z.infer<typeof betaHeadersFormSchema>;

// OpenAI Config tab
export const openaiConfigFormSchema = z.object({
disable_store: z.boolean(),
});

export type OpenAIConfigFormSchema = z.infer<typeof openaiConfigFormSchema>;

// OTEL Configuration Schema
export const otelConfigSchema = z
.object({
Expand Down
Loading