summaryrefslogtreecommitdiff
path: root/packages/server/src/core/geminiRequest.ts
diff options
context:
space:
mode:
authorTommaso Sciortino <[email protected]>2025-05-30 18:25:47 -0700
committerGitHub <[email protected]>2025-05-30 18:25:47 -0700
commit21fba832d1b4ea7af43fb887d9b2b38fcf8210d0 (patch)
tree7200d2fac3a55c385e0a2dac34b5282c942364bc /packages/server/src/core/geminiRequest.ts
parentc81148a0cc8489f657901c2cc7247c0834075e1a (diff)
Rename server->core (#638)
Diffstat (limited to 'packages/server/src/core/geminiRequest.ts')
-rw-r--r--packages/server/src/core/geminiRequest.ts71
1 files changed, 0 insertions, 71 deletions
diff --git a/packages/server/src/core/geminiRequest.ts b/packages/server/src/core/geminiRequest.ts
deleted file mode 100644
index e85bd51e..00000000
--- a/packages/server/src/core/geminiRequest.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * @license
- * Copyright 2025 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { type PartListUnion, type Part } from '@google/genai';
-
-/**
- * Represents a request to be sent to the Gemini API.
- * For now, it's an alias to PartListUnion as the primary content.
- * This can be expanded later to include other request parameters.
- */
-export type GeminiCodeRequest = PartListUnion;
-
-export function partListUnionToString(value: PartListUnion): string {
- if (typeof value === 'string') {
- return value;
- }
-
- if (Array.isArray(value)) {
- return value.map(partListUnionToString).join('');
- }
-
- // Cast to Part, assuming it might contain project-specific fields
- const part = value as Part & {
- videoMetadata?: unknown;
- thought?: string;
- codeExecutionResult?: unknown;
- executableCode?: unknown;
- };
-
- if (part.videoMetadata !== undefined) {
- return `[Video Metadata]`;
- }
-
- if (part.thought !== undefined) {
- return `[Thought: ${part.thought}]`;
- }
-
- if (part.codeExecutionResult !== undefined) {
- return `[Code Execution Result]`;
- }
-
- if (part.executableCode !== undefined) {
- return `[Executable Code]`;
- }
-
- // Standard Part fields
- if (part.fileData !== undefined) {
- return `[File Data]`;
- }
-
- if (part.functionCall !== undefined) {
- return `[Function Call: ${part.functionCall.name}]`;
- }
-
- if (part.functionResponse !== undefined) {
- return `[Function Response: ${part.functionResponse.name}]`;
- }
-
- if (part.inlineData !== undefined) {
- return `<${part.inlineData.mimeType}>`;
- }
-
- if (part.text !== undefined) {
- return part.text;
- }
-
- return '';
-}