mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
* Add reasoning egress policy guard * Assert reasoning denials hide API keys * Rerun validation * fix(daemon): reject malformed reasoning egress policy * Fix Google reasoning allowlist canonicalization
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import type { ReasoningExecutionRequestFields } from './reasoningExecution';
|
|
|
|
export type ProxyMessageRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
|
|
export type ProxyMessageContent =
|
|
| string
|
|
| Array<ProxyTextContentBlock | ProxyImageContentBlock>;
|
|
|
|
export interface ProxyTextContentBlock {
|
|
type: 'text';
|
|
text: string;
|
|
}
|
|
|
|
export interface ProxyImageContentBlock {
|
|
type: 'image';
|
|
source: {
|
|
type: 'base64';
|
|
media_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
|
|
data: string;
|
|
};
|
|
}
|
|
|
|
export interface ProxyMessage {
|
|
role: ProxyMessageRole;
|
|
content: ProxyMessageContent;
|
|
}
|
|
|
|
export interface ProxyStreamRequest extends ReasoningExecutionRequestFields {
|
|
baseUrl: string;
|
|
apiKey: string;
|
|
model: string;
|
|
systemPrompt?: string;
|
|
messages: ProxyMessage[];
|
|
// Caps the upstream completion length. Defaults to 8192 when unset so
|
|
// pre-existing clients keep their old behavior.
|
|
maxTokens?: number;
|
|
// Azure OpenAI only. Defaults at the daemon when omitted.
|
|
apiVersion?: string;
|
|
}
|
|
|
|
export interface ProxyStreamStartPayload {
|
|
model?: string;
|
|
}
|
|
|
|
export interface ProxyStreamDeltaPayload {
|
|
delta: string;
|
|
}
|
|
|
|
export interface ProxyStreamEndPayload {
|
|
code?: number;
|
|
}
|