MCPcopy Index your code
hub / github.com/simstudioai/sim / buildGeminiMessageParts

Function buildGeminiMessageParts

apps/sim/providers/attachments.ts:527–556  ·  view source on GitHub ↗
(
  content: string | null | undefined,
  files: UserFile[] | undefined,
  providerId: ProviderId | string
)

Source from the content-addressed store, hash-verified

525}
526
527export function buildGeminiMessageParts(
528 content: string | null | undefined,
529 files: UserFile[] | undefined,
530 providerId: ProviderId | string
531): Part[] {
532 const parts: Part[] = []
533 if (content) {
534 parts.push({ text: content } satisfies Part)
535 }
536
537 for (const attachment of prepareProviderAttachments(files, providerId)) {
538 parts.push(
539 attachment.providerFileUri
540 ? ({
541 fileData: {
542 fileUri: attachment.providerFileUri,
543 mimeType: attachment.providerMimeType,
544 },
545 } satisfies Part)
546 : ({
547 inlineData: {
548 mimeType: attachment.providerMimeType,
549 data: attachment.base64 ?? '',
550 },
551 } satisfies Part)
552 )
553 }
554
555 return parts
556}
557
558export function buildOpenAICompatibleChatContent(
559 content: string | null | undefined,

Callers 2

convertToGeminiFormatFunction · 0.90

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected