Skip to content

Commit

Permalink
Merge pull request #71 from AqeelAqeel/chaos-temperature
Browse files Browse the repository at this point in the history
added temperature parameter
  • Loading branch information
utf94 authored Mar 24, 2024
2 parents 81dc45b + 6e7ded4 commit 9f393cc
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 9f393cc

Please sign in to comment.