diff --git a/docs/src/content/docs/getting-started/configuration.mdx b/docs/src/content/docs/getting-started/configuration.mdx index 314e7d7af5..33a8b7d070 100644 --- a/docs/src/content/docs/getting-started/configuration.mdx +++ b/docs/src/content/docs/getting-started/configuration.mdx @@ -570,7 +570,7 @@ AZURE_SERVERLESS_OPENAI_API_KEY=... -### Azure AI Models +### Azure AI Models The `azure_serverless_models` provider supports non-OpenAI models deployed through the Azure AI Studio serverless deployments. diff --git a/packages/core/src/connection.ts b/packages/core/src/connection.ts index dbdb585341..7ae61b8467 100644 --- a/packages/core/src/connection.ts +++ b/packages/core/src/connection.ts @@ -261,7 +261,7 @@ export async function parseTokenFromEnv( throw new Error( "AZURE_SERVERLESS_MODELS_API_ENDPOINT not configured" ) - base = cleanAzureBase(base) + base = trimTrailingSlash(base) if (!URL.canParse(base)) throw new Error( "AZURE_SERVERLESS_MODELS_API_ENDPOINT must be a valid URL" diff --git a/packages/core/src/openai.ts b/packages/core/src/openai.ts index 7715cf2333..caa4ef834f 100644 --- a/packages/core/src/openai.ts +++ b/packages/core/src/openai.ts @@ -323,6 +323,7 @@ export const OpenAIChatCompletion: ChatCompletionHandler = async ( } } + trace.appendContent("\n\n") if (!postReq.stream) { const responseBody = await r.text() doChoices(responseBody, []) diff --git a/packages/sample/genaisrc/consistency.genai.mjs b/packages/sample/genaisrc/consistency.genai.mjs new file mode 100644 index 0000000000..d9a207c6bf --- /dev/null +++ b/packages/sample/genaisrc/consistency.genai.mjs @@ -0,0 +1,26 @@ +script({ + model: "azure_serverless_models:AI21-Jamba-1-5-Large-etzun", + files: "docs/src/content/docs/reference/**/*.{md,mdx}", + title: "check consistency", + system: ["system.assistant", "system.annotations"], +}) + +const files = env.files + .slice() + .filter((f) => !!f.content && f.content.length < 30000) // avoid massive autogenerated files + .sort((l, r) => l.content.length - r.content.length) // for rendering purposes + +console.log( + files + .map((file) => `${file.filename}: ${(file.content.length / 1e3) | 0}kb`) + .join("\n") +) +def("DOC", files) + +$` +You are a technical documentation expert. + +- Analyze the consistency, grammar, spell checking, writing quality of the content in DOC +- Analyze the consistency of all code snippets +- Report all issues using annotation format for all file. Be systematic and consistent in your analysis. +` diff --git a/packages/sample/genaisrc/summarize.genai.mjs b/packages/sample/genaisrc/summarize.genai.mjs index c5bce67fb8..50f66a691a 100644 --- a/packages/sample/genaisrc/summarize.genai.mjs +++ b/packages/sample/genaisrc/summarize.genai.mjs @@ -13,7 +13,8 @@ script({ def("FILE", env.files) $` -Summarize all files in FILE in a single page. +Summarize all files in FILE in a single paragraph. - Keep it short. - At most 3 paragraphs. +- Consider all files at once, do NOT summarize files individually. `