Skip to main content
Glama
index.ts1.27 kB
import { type AIConfig, type AIOptions, AIProvider, type TranslateJSONResultData, translateJSON as translateJSONAI, } from '@intlayer/ai'; import type { Locale } from '@intlayer/types'; import { logger } from '@logger'; import type { Tag } from '@/types/tag.types'; export type TranslateJSONOptions<T = JSON> = { entryFileContent: T; presetOutputContent: Partial<T>; dictionaryDescription?: string; entryLocale: Locale; outputLocale: Locale; tags: Tag[]; aiConfig: AIConfig; mode: 'complete' | 'review'; applicationContext?: string; }; export { type TranslateJSONResultData, AIProvider }; export const aiDefaultOptions: AIOptions = { provider: AIProvider.OPENAI, model: 'gpt-5-mini', }; /** * TranslateJSONs a content declaration file by constructing a prompt for AI models. * The prompt includes details about the project's locales, file paths of content declarations, * and requests for identifying issues or inconsistencies. */ export const translateJSON = async <T = JSON>( options: TranslateJSONOptions<T> ): Promise<TranslateJSONResultData<T> | undefined> => { const result = await translateJSONAI(options); if (result) { logger.info(`${result.tokenUsed} tokens used in the request`); } return result; };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server