Fix model override bug and add client REPL sample

- InputConverter: stop propagating request.Model to ChatOptions.ModelId
  Hosted agents use their own model; client-provided model values like
  'hosted-agent' were being passed through and causing server errors.
- Add FoundryResponsesRepl sample: interactive CLI client that connects
  to a Foundry Responses endpoint using ResponsesClient.AsAIAgent()
- Bump package version to 0.9.0-hosted.260403.1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
alliscode
2026-04-15 16:43:07 -07:00
co-authored by Copilot
parent eccdcffc6c
commit afce5665e2
7 changed files with 144 additions and 7 deletions
@@ -157,7 +157,7 @@ public class InputConverterTests
Assert.Equal(0.7f, options.Temperature);
Assert.Equal(0.9f, options.TopP);
Assert.Equal(1000, options.MaxOutputTokens);
Assert.Equal("gpt-4o", options.ModelId);
Assert.Null(options.ModelId);
}
[Fact]
@@ -659,12 +659,13 @@ public class InputConverterTests
}
[Fact]
public void ConvertToChatOptions_ModelId_SetFromRequest()
public void ConvertToChatOptions_ModelId_NotSetFromRequest()
{
var request = AzureAIAgentServerResponsesModelFactory.CreateResponse(model: "my-model");
var options = InputConverter.ConvertToChatOptions(request);
Assert.Equal("my-model", options.ModelId);
// Model from the request is intentionally NOT propagated — the hosted agent uses its own model.
Assert.Null(options.ModelId);
}
}