Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added temperature parameter #71

Merged
merged 1 commit into from
Mar 24, 2024
Merged
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: 4 additions & 0 deletions src/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export class BgentRuntime {
* @param opts.databaseAdapter - The database adapter used for interacting with the database.
* @param opts.fetch - Custom fetch function to use for making requests.
*/

constructor(opts: {
recentMessageCount?: number; // number of messages to hold in the recent message cache
agentId?: UUID; // ID of the agent
Expand Down Expand Up @@ -236,6 +237,7 @@ export class BgentRuntime {
* @param opts.model The model to use for completion.
* @param opts.frequency_penalty The frequency penalty to apply to the completion.
* @param opts.presence_penalty The presence penalty to apply to the completion.
* @param opts.temperature The temperature to apply to the completion.
* @returns The completed message.
*/
async completion({
Expand All @@ -244,6 +246,7 @@ export class BgentRuntime {
model = this.model,
frequency_penalty = 0.0,
presence_penalty = 0.0,
temperature = 0.7
}) {
const requestOptions = {
method: "POST",
Expand All @@ -256,6 +259,7 @@ export class BgentRuntime {
model,
frequency_penalty,
presence_penalty,
temperature,
messages: [
{
role: "user",
Expand Down
Loading