Skip to content

Commit

Permalink
more logging on run
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 29, 2024
1 parent 5ac9327 commit 1371029
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/cli/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export async function startServer(options: { port: string }) {
send({ trace: tev.chunk })
})
logVerbose(`run ${runId}: starting`)
logVerbose(YAMLStringify({ script, files, options }))
const runner = runScript(script, files, {
...options,
trace,
Expand Down
11 changes: 6 additions & 5 deletions packages/core/src/expander.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ export function resolveSystems(prj: Project, template: PromptScript) {
export async function expandTemplate(
prj: Project,
template: PromptScript,
files: { },
options: GenerationOptions,
env: ExpansionVariables,
trace: MarkdownTrace
Expand Down Expand Up @@ -317,10 +316,12 @@ export async function expandTemplate(
const chatParticipants = prompt.chatParticipants

if (prompt.logs?.length) trace.details("📝 console.log", prompt.logs)
if (prompt.text) {
trace.itemValue(`tokens`, estimateTokens(model, expanded))
trace.fence(prompt.text, "markdown")
}
if (prompt.text)
trace.detailsFenced(
`📝 prompt`,
prompt.text,
"markdown"
)
if (prompt.aici) trace.fence(prompt.aici, "yaml")
trace.endDetails()

Expand Down
1 change: 0 additions & 1 deletion packages/core/src/promptrunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export async function runTemplate(
} = await expandTemplate(
prj,
template,
fragment,
options,
vars as ExpansionVariables,
trace
Expand Down

0 comments on commit 1371029

Please sign in to comment.