Remove file upload functionality and related components

The `FileUploadStore` and all file upload features were removed, simplifying the chat interface. This change eliminates unused code, including file handling logic, attachment management, and UI elements, streamlining the application.
This commit is contained in:
geoffsee
2025-05-27 14:15:12 -04:00
committed by Geoff Seemueller
parent c04e19611e
commit 47272ba350
13 changed files with 105 additions and 302 deletions

View File

@@ -13,7 +13,6 @@ export class CloudflareAISdk {
param: {
openai: OpenAI;
systemPrompt: any;
disableWebhookGeneration: boolean;
preprocessedContext: ModelSnapshotType2<
ModelPropertiesDeclarationToProperties<{
role: ISimpleType<UnionStringArray<string[]>>;
@@ -21,12 +20,10 @@ export class CloudflareAISdk {
}>,
_NotCustomized
>;
attachments: any;
maxTokens: unknown | number | undefined;
messages: any;
model: string;
env: Env;
tools: any;
},
dataCallback: (data) => void,
) {
@@ -35,22 +32,18 @@ export class CloudflareAISdk {
messages,
env,
maxTokens,
tools,
systemPrompt,
model,
attachments,
} = param;
const assistantPrompt = ChatSdk.buildAssistantPrompt({
maxTokens: maxTokens,
tools: tools,
});
const safeMessages = ChatSdk.buildMessageChain(messages, {
systemPrompt: systemPrompt,
model,
assistantPrompt,
toolResults: preprocessedContext,
attachments: attachments,
});
const cfAiURL = `https://api.cloudflare.com/client/v4/accounts/${env.CLOUDFLARE_ACCOUNT_ID}/ai/v1`;