Skip to content

Commit 9b42af2

Browse files
committed
Added Anthropic Endpoint
1 parent 8873a06 commit 9b42af2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog - Agent Framework Toolkit
22

3+
## Unreleased
4+
- Anthropic: Added `Endpoint` property to connection so you can override the default BaseUrl (and example consume an Anthropic model from Microsoft Foundry using the Anthropic API)
5+
6+
---
7+
38
## Version 1.0.0-preview.251230.1
49
- Added `OpenAIEmbeddingModels` const-collection of Open AI Embedding Models
510
- Exposed `Connection` as a Property on all Factories

src/AgentFrameworkToolkit.Anthropic/AnthropicConnection.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ public class AnthropicConnection
1818
/// </summary>
1919
public TimeSpan? NetworkTimeout { get; set; }
2020

21+
/// <summary>
22+
/// Set the BaseUrl of the Client (if you need to the API from a non-default Endpoint; example Microsoft Foundry)
23+
/// </summary>
24+
public string? Endpoint { get; set; }
25+
2126
/// <summary>
2227
/// Get a Raw Client
2328
/// </summary>
@@ -44,6 +49,12 @@ public AnthropicClient GetClient(Action<RawCallDetails>? rawHttpCallDetails = nu
4449
APIKey = ApiKey,
4550
Timeout = NetworkTimeout
4651
};
52+
53+
if (!string.IsNullOrWhiteSpace(Endpoint))
54+
{
55+
clientOptions.BaseUrl = new Uri(Endpoint);
56+
}
57+
4758
if (httpClient != null)
4859
{
4960
clientOptions.HttpClient = httpClient;

0 commit comments

Comments
 (0)