Skip to content

Commit

Permalink
Include tool details when counting message tokens (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens authored Jan 29, 2025
1 parent 1f7fc2f commit fa634ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/base/promptRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,8 @@ async function computeTokensConsumedByLiterals(
role: element.props.role,
content: '',
...(element.props.name ? { name: element.props.name } : undefined),
...(element.props.toolCalls ? { tool_calls: element.props.toolCalls } : undefined),
...(element.props.toolCallId ? { tool_call_id: element.props.toolCallId } : undefined),
});
}

Expand Down

0 comments on commit fa634ca

Please sign in to comment.