MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / buildGeminiParts

Function buildGeminiParts

ai/ai.ts:2322–2344  ·  view source on GitHub ↗
(
  prompt: string,
  images: AIContentPart[],
  httpClient: HttpClient,
  token?: AbortToken,
)

Source from the content-addressed store, hash-verified

2320
2321const buildGeminiParts = async (
2322 prompt: string,
2323 images: AIContentPart[],
2324 httpClient: HttpClient,
2325 token?: AbortToken,
2326): Promise<Array<Record<string, any>>> => {
2327 const parts: Array<Record<string, any>> = [];
2328 if (prompt.trim()) parts.push({ text: prompt });
2329
2330 const resolvedImages = await resolveImageInputs(images, httpClient, token, {
2331 allowFailures: true,
2332 });
2333 for (const image of resolvedImages) {
2334 parts.push({
2335 inlineData: {
2336 data: image.data.toString("base64"),
2337 mimeType: image.mimeType,
2338 },
2339 });
2340 }
2341
2342 return parts;
2343};
2344
2345class FeatureRegistry {
2346 private features = new Map<string, FeatureHandler>();
2347

Callers 2

generateGeminiVideoMethod · 0.85

Calls 1

resolveImageInputsFunction · 0.85

Tested by

no test coverage detected