diff --git a/frontend/src/api/admin/channelMonitor.ts b/frontend/src/api/admin/channelMonitor.ts index 949c4bc8..bdef7d33 100644 --- a/frontend/src/api/admin/channelMonitor.ts +++ b/frontend/src/api/admin/channelMonitor.ts @@ -8,11 +8,13 @@ import { apiClient } from '../client' export type Provider = 'openai' | 'anthropic' | 'gemini' export type MonitorStatus = 'operational' | 'degraded' | 'failed' | 'error' export type BodyOverrideMode = 'off' | 'merge' | 'replace' +export type APIMode = 'chat_completions' | 'responses' export interface ChannelMonitor { id: number name: string provider: Provider + api_mode: APIMode endpoint: string api_key_masked: string /** @@ -70,6 +72,7 @@ export interface ListResponse { export interface CreateParams { name: string provider: Provider + api_mode?: APIMode endpoint: string api_key: string primary_model: string diff --git a/frontend/src/api/admin/channelMonitorTemplate.ts b/frontend/src/api/admin/channelMonitorTemplate.ts index 01b3c2d0..7b048104 100644 --- a/frontend/src/api/admin/channelMonitorTemplate.ts +++ b/frontend/src/api/admin/channelMonitorTemplate.ts @@ -6,12 +6,13 @@ */ import { apiClient } from '../client' -import type { BodyOverrideMode, Provider } from './channelMonitor' +import type { APIMode, BodyOverrideMode, Provider } from './channelMonitor' export interface ChannelMonitorTemplate { id: number name: string provider: Provider + api_mode: APIMode description: string extra_headers: Record body_override_mode: BodyOverrideMode @@ -24,6 +25,7 @@ export interface ChannelMonitorTemplate { export interface ListParams { provider?: Provider + api_mode?: APIMode } export interface ListResponse { @@ -33,6 +35,7 @@ export interface ListResponse { export interface CreateParams { name: string provider: Provider + api_mode?: APIMode description?: string extra_headers?: Record body_override_mode?: BodyOverrideMode @@ -41,6 +44,7 @@ export interface CreateParams { export interface UpdateParams { name?: string + api_mode?: APIMode description?: string extra_headers?: Record body_override_mode?: BodyOverrideMode @@ -55,6 +59,7 @@ export interface AssociatedMonitorBrief { id: number name: string provider: Provider + api_mode: APIMode enabled: boolean } diff --git a/frontend/src/constants/channelMonitor.ts b/frontend/src/constants/channelMonitor.ts index 7523a878..eb99680c 100644 --- a/frontend/src/constants/channelMonitor.ts +++ b/frontend/src/constants/channelMonitor.ts @@ -7,18 +7,26 @@ * `useChannelMonitorFormat`. */ -import type { Provider, MonitorStatus } from '@/api/admin/channelMonitor' +import type { APIMode, Provider, MonitorStatus } from '@/api/admin/channelMonitor' export const PROVIDER_OPENAI: Provider = 'openai' export const PROVIDER_ANTHROPIC: Provider = 'anthropic' export const PROVIDER_GEMINI: Provider = 'gemini' +export const API_MODE_CHAT_COMPLETIONS: APIMode = 'chat_completions' +export const API_MODE_RESPONSES: APIMode = 'responses' + export const PROVIDERS: readonly Provider[] = [ PROVIDER_OPENAI, PROVIDER_ANTHROPIC, PROVIDER_GEMINI, ] +export const API_MODES: readonly APIMode[] = [ + API_MODE_CHAT_COMPLETIONS, + API_MODE_RESPONSES, +] + export const STATUS_OPERATIONAL: MonitorStatus = 'operational' export const STATUS_DEGRADED: MonitorStatus = 'degraded' export const STATUS_FAILED: MonitorStatus = 'failed'