mirror of https://github.com/buster-so/buster.git
update create link helper
This commit is contained in:
parent
aed85a32b2
commit
108d0a5a17
|
@ -3,7 +3,10 @@ import { z } from 'zod';
|
||||||
const CreateHrefFromLinkParamsSchema = z.object({
|
const CreateHrefFromLinkParamsSchema = z.object({
|
||||||
to: z.string().describe('Route path with param placeholders like /path/$paramName'),
|
to: z.string().describe('Route path with param placeholders like /path/$paramName'),
|
||||||
params: z.record(z.string()).describe('Object mapping param names to values'),
|
params: z.record(z.string()).describe('Object mapping param names to values'),
|
||||||
search: z.record(z.union([z.string(), z.number(), z.boolean(), z.undefined()])).optional().describe('Query parameters'),
|
search: z
|
||||||
|
.record(z.union([z.string(), z.number(), z.boolean(), z.undefined()]))
|
||||||
|
.optional()
|
||||||
|
.describe('Query parameters'),
|
||||||
});
|
});
|
||||||
|
|
||||||
type CreateHrefFromLinkParams = z.infer<typeof CreateHrefFromLinkParamsSchema>;
|
type CreateHrefFromLinkParams = z.infer<typeof CreateHrefFromLinkParamsSchema>;
|
||||||
|
|
|
@ -123,10 +123,10 @@ export function createAnalystAgent(analystAgentOptions: AnalystAgentOptions) {
|
||||||
|
|
||||||
const docsSystemMessage = docsContent
|
const docsSystemMessage = docsContent
|
||||||
? ({
|
? ({
|
||||||
role: 'system',
|
role: 'system',
|
||||||
content: `<data_catalog_docs>\n${docsContent}\n</data_catalog_docs>`,
|
content: `<data_catalog_docs>\n${docsContent}\n</data_catalog_docs>`,
|
||||||
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
||||||
} as ModelMessage)
|
} as ModelMessage)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
async function stream({ messages }: AnalystStreamOptions) {
|
async function stream({ messages }: AnalystStreamOptions) {
|
||||||
|
@ -183,19 +183,19 @@ export function createAnalystAgent(analystAgentOptions: AnalystAgentOptions) {
|
||||||
// Create analyst instructions system message with proper escaping
|
// Create analyst instructions system message with proper escaping
|
||||||
const analystInstructionsMessage = analystInstructions
|
const analystInstructionsMessage = analystInstructions
|
||||||
? ({
|
? ({
|
||||||
role: 'system',
|
role: 'system',
|
||||||
content: `<organization_instructions>\n${analystInstructions}\n</organization_instructions>`,
|
content: `<organization_instructions>\n${analystInstructions}\n</organization_instructions>`,
|
||||||
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
||||||
} as ModelMessage)
|
} as ModelMessage)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
// Create user personalization system message
|
// Create user personalization system message
|
||||||
const userPersonalizationSystemMessage = userPersonalizationMessageContent
|
const userPersonalizationSystemMessage = userPersonalizationMessageContent
|
||||||
? ({
|
? ({
|
||||||
role: 'system',
|
role: 'system',
|
||||||
content: userPersonalizationMessageContent,
|
content: userPersonalizationMessageContent,
|
||||||
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
||||||
} as ModelMessage)
|
} as ModelMessage)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
return wrapTraced(
|
return wrapTraced(
|
||||||
|
|
Loading…
Reference in New Issue