@@ -22,14 +22,14 @@ public class OllamaChatClientTests
2222 [ Fact ]
2323 public void Ctor_InvalidArgs_Throws ( )
2424 {
25- Assert . Throws < ArgumentNullException > ( "endpoint" , ( ) => new OllamaChatClient ( null ! ) ) ;
26- Assert . Throws < ArgumentException > ( "modelId" , ( ) => new OllamaChatClient ( new ( "http://localhost" ) , " " ) ) ;
25+ Assert . Throws < ArgumentNullException > ( "endpoint" , ( ) => new OllamaChatClient ( ( Uri ) null ! ) ) ;
26+ Assert . Throws < ArgumentException > ( "modelId" , ( ) => new OllamaChatClient ( "http://localhost" , " " ) ) ;
2727 }
2828
2929 [ Fact ]
3030 public void GetService_SuccessfullyReturnsUnderlyingClient ( )
3131 {
32- using OllamaChatClient client = new ( new ( "http://localhost" ) ) ;
32+ using OllamaChatClient client = new ( "http://localhost" ) ;
3333
3434 Assert . Same ( client , client . GetService < OllamaChatClient > ( ) ) ;
3535 Assert . Same ( client , client . GetService < IChatClient > ( ) ) ;
@@ -94,7 +94,7 @@ public async Task BasicRequestResponse_NonStreaming()
9494
9595 using VerbatimHttpHandler handler = new ( Input , Output ) ;
9696 using HttpClient httpClient = new ( handler ) ;
97- using OllamaChatClient client = new ( new ( "http://localhost:11434" ) , "llama3.1" , httpClient ) ;
97+ using OllamaChatClient client = new ( "http://localhost:11434" , "llama3.1" , httpClient ) ;
9898 var response = await client . CompleteAsync ( "hello" , new ( )
9999 {
100100 MaxOutputTokens = 10 ,
@@ -152,7 +152,7 @@ public async Task BasicRequestResponse_Streaming()
152152
153153 using VerbatimHttpHandler handler = new ( Input , Output ) ;
154154 using HttpClient httpClient = new ( handler ) ;
155- using IChatClient client = new OllamaChatClient ( new ( "http://localhost:11434" ) , "llama3.1" , httpClient ) ;
155+ using IChatClient client = new OllamaChatClient ( "http://localhost:11434" , "llama3.1" , httpClient ) ;
156156
157157 List < StreamingChatCompletionUpdate > updates = [ ] ;
158158 await foreach ( var update in client . CompleteStreamingAsync ( "hello" , new ( )
@@ -238,7 +238,7 @@ public async Task MultipleMessages_NonStreaming()
238238
239239 using VerbatimHttpHandler handler = new ( Input , Output ) ;
240240 using HttpClient httpClient = new ( handler ) ;
241- using IChatClient client = new OllamaChatClient ( new ( "http://localhost:11434" ) , httpClient : httpClient ) ;
241+ using IChatClient client = new OllamaChatClient ( "http://localhost:11434" , httpClient : httpClient ) ;
242242
243243 List < ChatMessage > messages =
244244 [
@@ -342,7 +342,7 @@ public async Task FunctionCallContent_NonStreaming()
342342
343343 using VerbatimHttpHandler handler = new ( Input , Output ) ;
344344 using HttpClient httpClient = new ( handler ) { Timeout = Timeout . InfiniteTimeSpan } ;
345- using IChatClient client = new OllamaChatClient ( new ( "http://localhost:11434" ) , "llama3.1" , httpClient )
345+ using IChatClient client = new OllamaChatClient ( "http://localhost:11434" , "llama3.1" , httpClient )
346346 {
347347 ToolCallJsonSerializerOptions = TestJsonSerializerContext . Default . Options ,
348348 } ;
@@ -434,7 +434,7 @@ public async Task FunctionResultContent_NonStreaming()
434434
435435 using VerbatimHttpHandler handler = new ( Input , Output ) ;
436436 using HttpClient httpClient = new ( handler ) { Timeout = Timeout . InfiniteTimeSpan } ;
437- using IChatClient client = new OllamaChatClient ( new ( "http://localhost:11434" ) , "llama3.1" , httpClient )
437+ using IChatClient client = new OllamaChatClient ( "http://localhost:11434" , "llama3.1" , httpClient )
438438 {
439439 ToolCallJsonSerializerOptions = TestJsonSerializerContext . Default . Options ,
440440 } ;
0 commit comments