Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/runpromptcontext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ export function createChatGenerationContext(
async (_) => {
if (typeof fn === "string") _.writeText(dedent(fn))
else await fn(_, args)
_.$`- Assume that your answer will be analyzed by an LLM, not a human.
_.$`Make a plan and solve this task.

- Assume that your answer will be analyzed by an LLM, not a human.
- If you are missing information, reply "MISSING_INFO: <what is missing>".
- If you cannot answer the query, return "NO_ANSWER: <reason>".
- Be concise. Minimize output to the most relevant information to save context tokens.`
Expand Down
11 changes: 6 additions & 5 deletions packages/core/src/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ export function estimateCost(modelId: string, usage: ChatCompletionUsage) {
}

export function renderCost(value: number) {
return value !== undefined
? value <= 0.1
? `${(value * 100).toFixed(2)}¢`
: `${value.toFixed(2)}$`
: ""
if (isNaN(value)) return ""
return value <= 0.01
? `${(value * 100).toFixed(3)}¢`
: value <= 0.1
? `${(value * 100).toFixed(2)}¢`
: `${value.toFixed(2)}$`
}

export class GenerationStats {
Expand Down
4 changes: 4 additions & 0 deletions packages/sample/genaisrc/prd-min.genai.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
script({ tools: ["agent_fs", "agent_git"] })

$`Generate a pull request description for the changes in the current branch.
Make a plan and solve this task. Keep it short.`
Loading