Skip to content

Commit 057918f

Browse files
committed
Change LogitBias to IReadOnlyDictionary
1 parent d793f7c commit 057918f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

OpenAI_API/Chat/ChatEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public Task<ChatResult> CreateChatAsync(IEnumerable<ChatMessage> messages,
7474
int? max_tokens = null,
7575
double? frequencyPenalty = null,
7676
double? presencePenalty = null,
77-
Dictionary<string, float> logitBias = null,
77+
IReadOnlyDictionary<string, float> logitBias = null,
7878
params string[] stopSequences)
7979
{
8080
ChatRequest request = new ChatRequest(DefaultChatRequestArgs)
@@ -176,7 +176,7 @@ public IAsyncEnumerable<ChatResult> StreamChatEnumerableAsync(IEnumerable<ChatMe
176176
int? max_tokens = null,
177177
double? frequencyPenalty = null,
178178
double? presencePenalty = null,
179-
Dictionary<string, float> logitBias = null,
179+
IReadOnlyDictionary<string, float> logitBias = null,
180180
params string[] stopSequences)
181181
{
182182
ChatRequest request = new ChatRequest(DefaultChatRequestArgs)

OpenAI_API/Chat/ChatRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Newtonsoft.Json;
1+
using Newtonsoft.Json;
22
using System;
33
using System.Collections.Generic;
44
using System.Linq;
@@ -111,7 +111,7 @@ public string StopSequence
111111
/// The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
112112
/// </summary>
113113
[JsonProperty("logit_bias")]
114-
public Dictionary<string, float> LogitBias { get; set; }
114+
public IReadOnlyDictionary<string, float> LogitBias { get; set; }
115115

116116
/// <summary>
117117
/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

0 commit comments

Comments
 (0)