Skip to content

Commit

Permalink
ais: fix context dump
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil committed Dec 13, 2023
1 parent f898bd2 commit 6ed1f01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kyo-llm/shared/src/main/scala/kyo/llm/contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ object contexts {
if (s.contains('\n') || s.contains('"') || s.contains('\\')) s"p\"\"\"$s\"\"\""
else s""""$s""""
}
val seedStr = seed.map(s => s".seed(${stringify(s)})").getOrElse("")
val reminderStr = reminder.map(s => s".reminder(${stringify(s)})").getOrElse("")
val seedStr = seed.map(s => s"\n .seed(${stringify(s)})").getOrElse("")
val reminderStr = reminder.map(s => s"\n .reminder(${stringify(s)})").getOrElse("")
val messagesStr = messages.reverse.map {
case Message.SystemMessage(content, _) =>
s"\n .systemMessage(${stringify(content)})"
Expand All @@ -112,9 +112,9 @@ object contexts {
s"\n .assistantMessage(${stringify(content)}${if (calls.isEmpty) ""
else s", List($callsStr)"})"
case Message.AgentMessage(callId, content, _) =>
s"\n .toolMessage(CallId(\"${callId.id}\"), ${stringify(content)})"
s"\n .agentMessage(CallId(\"${callId.id}\"), ${stringify(content)})"
}.mkString
s"Contexts.init$seedStr$reminderStr$messagesStr"
s"Context.empty$seedStr$reminderStr$messagesStr"
}
}

Expand Down

0 comments on commit 6ed1f01

Please sign in to comment.