Skip to content

Commit

Permalink
Merge pull request #77 from Plootie/main
Browse files Browse the repository at this point in the history
Expose RequestOptions for Chat
  • Loading branch information
awaescher authored Sep 12, 2024
2 parents a11d1b6 + 7653519 commit d0bc647
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Chat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using OllamaSharp.Models;
using OllamaSharp.Models.Chat;

namespace OllamaSharp;
Expand All @@ -26,6 +27,11 @@ public class Chat
/// Gets or sets the AI model to chat with
/// </summary>
public string Model { get; set; }

/// <summary>
/// Gets or sets the RequestOptions to chat with
/// </summary>
public RequestOptions? Options { get; set; }

/// <summary>
/// Creates a new chat instance
Expand Down Expand Up @@ -97,7 +103,8 @@ public async IAsyncEnumerable<string> SendAs(ChatRole role, string message, IEnu
Messages = Messages,
Model = Model,
Stream = !hasTools, // cannot stream if tools should be used
Tools = tools
Tools = tools,
Options = Options
};

var messageBuilder = new MessageBuilder();
Expand Down

0 comments on commit d0bc647

Please sign in to comment.