Skip to content

Commit

Permalink
Change messages from list to Dictionary in AddMessagesToThread Payload
Browse files Browse the repository at this point in the history
  • Loading branch information
GeeksAmin committed Nov 18, 2024
1 parent b65c825 commit 737833e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Olive.Gpt/ApiDto/ChatRequestThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ namespace Olive.Gpt.ApiDto
{
class ChatRequestThread
{
public ChatRequestThread(ChatMessage[] messages) => Messages = messages;
public ChatRequestThread(ChatMessage[] messages)
{
foreach (var item in messages)
{
Messages.Add(item.Role, item.Content);
}
}

[JsonProperty("messages")]
public ChatMessage[] Messages { get; set; }
public Dictionary<string, object> Messages { get; set; }
}
}
2 changes: 1 addition & 1 deletion Olive.Gpt/Olive.Gpt.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.1.3</Version>
<Version>1.1.4</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down

0 comments on commit 737833e

Please sign in to comment.