Refactor assistant message

This commit is contained in:
Saoud Rizwan
2024-10-06 04:14:52 -04:00
parent 05eab1f22f
commit 7ee0a58f9b
3 changed files with 4 additions and 3 deletions

View File

@@ -36,8 +36,7 @@ import { calculateApiCost } from "../utils/cost"
import { fileExistsAtPath } from "../utils/fs"
import { arePathsEqual, getReadablePath } from "../utils/path"
import { parseMentions } from "./mentions"
import { AssistantMessageContent, ToolParamName, ToolUseName } from "./assistant-message"
import { parseAssistantMessage } from "./assistant-message/parse-assistant-message"
import { AssistantMessageContent, parseAssistantMessage, ToolParamName, ToolUseName } from "./assistant-message"
import { formatResponse } from "./prompts/responses"
import { addCustomInstructions, SYSTEM_PROMPT } from "./prompts/system"
import { truncateHalfConversation } from "./sliding-window"

View File

@@ -1,5 +1,7 @@
export type AssistantMessageContent = TextContent | ToolUse
export { parseAssistantMessage } from "./parse-assistant-message"
export interface TextContent {
type: "text"
content: string

View File

@@ -6,7 +6,7 @@ import {
toolParamNames,
toolUseNames,
ToolUseName,
} from "./AssistantMessage"
} from "."
export function parseAssistantMessage(assistantMessage: string) {
let contentBlocks: AssistantMessageContent[] = []