mirror of https://github.com/buster-so/buster.git
23 lines
394 B
TypeScript
23 lines
394 B
TypeScript
import type { ModelMessage } from 'ai';
|
|
|
|
export function createRawToolResultEntry<T>(
|
|
toolCallId: string,
|
|
toolName: string,
|
|
output: T
|
|
): ModelMessage {
|
|
return {
|
|
role: 'tool',
|
|
content: [
|
|
{
|
|
type: 'tool-result',
|
|
toolCallId,
|
|
toolName,
|
|
output: {
|
|
type: 'json',
|
|
value: JSON.stringify(output),
|
|
},
|
|
},
|
|
],
|
|
};
|
|
}
|