Skip to content

Commit 6c805a3

Browse files
authored
[Azure.AI.Projects] URL Citations (Azure#48759)
* Update with typespec changes for assistant -> agent id. Update sample for url citation Signed-off-by: trangevi <[email protected]> * Test updates Signed-off-by: trangevi <[email protected]> * update changelog Signed-off-by: trangevi <[email protected]> * regen Signed-off-by: trangevi <[email protected]> * Changelog update Signed-off-by: trangevi <[email protected]> --------- Signed-off-by: trangevi <[email protected]>
1 parent fab9750 commit 6c805a3

39 files changed

+1318
-222
lines changed

sdk/ai/Azure.AI.Projects/CHANGELOG.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# Release History
22

3-
## 1.0.0-beta.5 (Unreleased)
3+
## 1.0.0-beta.5 (2025-03-13)
44

55
### Features Added
66

77
* Added `ConnectionProvider` abstraction in `AIProjectClient` to enable seamless connectivity with Azure OpenAI, Inference, and Search SDKs.
8+
* Added support for URL citations with the `MessageTextUrlCitationAnnotation` class. `MessageTextContent` objects now can possibly have `Annotations` populated in order to provide information on URL citations.
89

910
### Breaking Changes
1011

11-
### Bugs Fixed
12-
13-
### Other Changes
12+
* `assistantId` has been renamed to `agentId` throughout the package.
1413

1514
## 1.0.0-beta.4 (2025-02-28)
1615

sdk/ai/Azure.AI.Projects/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ AgentsClient client = new AgentsClient(connectionString, new DefaultAzureCredent
8787
With an authenticated client, an agent can be created:
8888
```C# Snippet:OverviewCreateAgent
8989
Response<Agent> agentResponse = await client.CreateAgentAsync(
90-
model: "gpt-4-1106-preview",
90+
model: "gpt-4",
9191
name: "Math Tutor",
9292
instructions: "You are a personal math tutor. Write and run code to answer math questions.",
9393
tools: new List<ToolDefinition> { new CodeInterpreterToolDefinition() });
@@ -201,7 +201,7 @@ fileSearchToolResource.VectorStoreIds.Add(vectorStore.Id);
201201

202202
// Create an agent with toolResources and process assistant run
203203
Response<Agent> agentResponse = await client.CreateAgentAsync(
204-
model: "gpt-4-1106-preview",
204+
model: "gpt-4",
205205
name: "SDK Test Agent - Retrieval",
206206
instructions: "You are a helpful agent that can help fetch data from files you know about.",
207207
tools: new List<ToolDefinition> { new FileSearchToolDefinition() },

sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs

Lines changed: 71 additions & 17 deletions
Large diffs are not rendered by default.

sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs

Lines changed: 71 additions & 17 deletions
Large diffs are not rendered by default.

sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public partial class AgentsClient
2121
/// <see cref="Agent"/>.
2222
/// </summary>
2323
/// <param name="threadId"> Identifier of the thread. </param>
24-
/// <param name="assistantId"> The ID of the agent that should run the thread. </param>
24+
/// <param name="agentId"> The ID of the agent that should run the thread. </param>
2525
/// <param name="overrideModelName"> The overridden model name that the agent should use to run the thread. </param>
2626
/// <param name="overrideInstructions"> The overridden system instructions that the agent should use to run the thread. </param>
2727
/// <param name="additionalInstructions">
@@ -57,17 +57,17 @@ public partial class AgentsClient
5757
/// <param name="parallelToolCalls"> If `true` functions will run in parallel during tool use. </param>
5858
/// <param name="metadata"> A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. </param>
5959
/// <param name="cancellationToken"> The cancellation token to use. </param>
60-
/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="assistantId"/> is null. </exception>
60+
/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="agentId"/> is null. </exception>
6161
/// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
6262
#pragma warning disable AZC0015 // Unexpected client method return type.
63-
public virtual AsyncCollectionResult<StreamingUpdate> CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable<ThreadMessageOptions> additionalMessages = null, IEnumerable<ToolDefinition> overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary<string, string> metadata = null, CancellationToken cancellationToken = default)
63+
public virtual AsyncCollectionResult<StreamingUpdate> CreateRunStreamingAsync(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable<ThreadMessageOptions> additionalMessages = null, IEnumerable<ToolDefinition> overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary<string, string> metadata = null, CancellationToken cancellationToken = default)
6464
#pragma warning restore AZC0015 // Unexpected client method return type.
6565
{
6666
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
67-
Argument.AssertNotNull(assistantId, nameof(assistantId));
67+
Argument.AssertNotNull(agentId, nameof(agentId));
6868

6969
CreateRunRequest createRunRequest = new CreateRunRequest(
70-
assistantId,
70+
agentId,
7171
overrideModelName,
7272
overrideInstructions,
7373
additionalInstructions,
@@ -97,7 +97,7 @@ async Task<Response> sendRequestAsync() =>
9797
/// <see cref="Agent"/>.
9898
/// </summary>
9999
/// <param name="threadId"> Identifier of the thread. </param>
100-
/// <param name="assistantId"> The ID of the agent that should run the thread. </param>
100+
/// <param name="agentId"> The ID of the agent that should run the thread. </param>
101101
/// <param name="overrideModelName"> The overridden model name that the agent should use to run the thread. </param>
102102
/// <param name="overrideInstructions"> The overridden system instructions that the agent should use to run the thread. </param>
103103
/// <param name="additionalInstructions">
@@ -133,17 +133,17 @@ async Task<Response> sendRequestAsync() =>
133133
/// <param name="parallelToolCalls"> If `true` functions will run in parallel during tool use. </param>
134134
/// <param name="metadata"> A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. </param>
135135
/// <param name="cancellationToken"> The cancellation token to use. </param>
136-
/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="assistantId"/> is null. </exception>
136+
/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="agentId"/> is null. </exception>
137137
/// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
138138
#pragma warning disable AZC0015 // Unexpected client method return type.
139-
public virtual CollectionResult<StreamingUpdate> CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable<ThreadMessageOptions> additionalMessages = null, IEnumerable<ToolDefinition> overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary<string, string> metadata = null, CancellationToken cancellationToken = default)
139+
public virtual CollectionResult<StreamingUpdate> CreateRunStreaming(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable<ThreadMessageOptions> additionalMessages = null, IEnumerable<ToolDefinition> overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary<string, string> metadata = null, CancellationToken cancellationToken = default)
140140
#pragma warning restore AZC0015 // Unexpected client method return type.
141141
{
142142
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
143-
Argument.AssertNotNull(assistantId, nameof(assistantId));
143+
Argument.AssertNotNull(agentId, nameof(agentId));
144144

145145
CreateRunRequest createRunRequest = new CreateRunRequest(
146-
assistantId,
146+
agentId,
147147
overrideModelName,
148148
overrideInstructions,
149149
additionalInstructions,

sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs

Lines changed: 53 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)