style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
+17
-9
@@ -1,5 +1,5 @@
|
||||
import { promises as fs } from "fs";
|
||||
import path from "path";
|
||||
import { promises as fs } from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
interface PromptContext {
|
||||
name: string;
|
||||
@@ -36,7 +36,9 @@ async function loadSchemaSummary(): Promise<string> {
|
||||
const body = match[2]
|
||||
.split("\n")
|
||||
.map((line) => line.trim())
|
||||
.filter((line) => line && !line.startsWith("//") && !line.startsWith("@@"))
|
||||
.filter(
|
||||
(line) => line && !line.startsWith("//") && !line.startsWith("@@"),
|
||||
)
|
||||
.join("\n");
|
||||
|
||||
blocks.push(`Model ${modelName} {\n${body}\n}`);
|
||||
@@ -60,7 +62,10 @@ Front-end fields (AdminItemForm):
|
||||
- dynamic metadata: campos variáveis definidos por categoria (servidores, atributos, etc)
|
||||
`.trim();
|
||||
|
||||
export async function buildItemPrompt(context: PromptContext, extraInstructions?: string) {
|
||||
export async function buildItemPrompt(
|
||||
context: PromptContext,
|
||||
extraInstructions?: string,
|
||||
) {
|
||||
const schemaSummary = await loadSchemaSummary();
|
||||
|
||||
const categoriesText =
|
||||
@@ -150,10 +155,14 @@ export interface InlineImageData {
|
||||
base64Data: string;
|
||||
}
|
||||
|
||||
export async function buildGeminiParts(prompt: string, images: InlineImageData[] = []) {
|
||||
const parts: Array<{ text?: string; inline_data?: { mimeType: string; data: string } }> = [
|
||||
{ text: prompt },
|
||||
];
|
||||
export async function buildGeminiParts(
|
||||
prompt: string,
|
||||
images: InlineImageData[] = [],
|
||||
) {
|
||||
const parts: Array<{
|
||||
text?: string;
|
||||
inline_data?: { mimeType: string; data: string };
|
||||
}> = [{ text: prompt }];
|
||||
|
||||
images.slice(0, 2).forEach((image) => {
|
||||
parts.push({
|
||||
@@ -166,4 +175,3 @@ export async function buildGeminiParts(prompt: string, images: InlineImageData[]
|
||||
|
||||
return parts;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user