-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Create classes ad sample code for Azure Functions #47319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
28b9aab
Add first draft
nick863 74283e9
draft
nick863 571440b
Check in funxtional sample
nick863 b7e6b50
Generate code and create and example for Azure function
nick863 d682176
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
nick863 0b5b818
Fix
nick863 127cc6f
Merge to upstream
nick863 0ebd687
Generate new code and port parallel run
nick863 92c4cf9
Update docs
nick863 44643fc
Fix
nick863 d7f856d
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
nick863 141ee77
Rename parameter and regenerate the code
nick863 5a2010f
Add newly generated files
nick863 d01d84a
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
nick863 3727d86
Regenerate the code
nick863 f9838d2
Update code to new specs
nick863 f20ee3c
Add OpenAPI example.
nick863 a03507d
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
nick863 7c2a81e
Update changelog
nick863 23806de
Add new files
nick863 c6931ff
Fix comment
nick863 936498e
Add bug to the changelog
nick863 e50f916
Fix
nick863 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
62 changes: 55 additions & 7 deletions
62
sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
sdk/ai/Azure.AI.Projects/src/Custom/Agent/AzureFunctionToolDefinition.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| // <auto-generated/> | ||
|
|
||
nick863 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using Azure.Core; | ||
|
|
||
| namespace Azure.AI.Projects | ||
| { | ||
| [CodeGenSuppress("AzureFunctionToolDefinition", typeof(InternalAzureFunctionDefinition))] | ||
| public partial class AzureFunctionToolDefinition | ||
ShivangiReja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| /// <inheritdoc cref="InternalFunctionDefinition.Name"/> | ||
| public string Name => InternalAzureFunction.Function.Name; | ||
|
|
||
| /// <inheritdoc cref="InternalFunctionDefinition.Description"/> | ||
| public string Description => InternalAzureFunction.Function.Description; | ||
|
|
||
| /// <inheritdoc cref="InternalFunctionDefinition.Parameters"/> | ||
| public BinaryData Parameters => InternalAzureFunction.Function.Parameters; | ||
|
|
||
| /// <summary> The definition of the function that the function tool should call. </summary> | ||
| internal InternalAzureFunctionDefinition InternalAzureFunction { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of AzureFunctionDefinition. | ||
| /// </summary> | ||
| /// <param name="name"> The name of the Azure function to be called. </param> | ||
| /// <param name="description"> A description of what the Azure function does, used by the model to choose when and how to call the function. </param> | ||
| /// <param name="inputBinding">Input storage queue.</param> | ||
| /// <param name="outputBinding">Output storage queue.</param> | ||
| /// <param name="parameters"> The parameters the Azure functions accepts, described as a JSON Schema object. </param> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="description"/> or <paramref name="parameters"/> is null. </exception> | ||
| public AzureFunctionToolDefinition(string name, string description, AzureStorageQueueBinding inputBinding, AzureStorageQueueBinding outputBinding, BinaryData parameters) | ||
| : this(type: "azure_function", serializedAdditionalRawData: null, new InternalAzureFunctionDefinition(new InternalFunctionDefinition(name, description, parameters, serializedAdditionalRawData: null), inputBinding: inputBinding, outputBinding: outputBinding)) | ||
| { | ||
| } | ||
|
|
||
| /// <inheritdoc/> | ||
| public override bool Equals(object obj) | ||
| => (obj is AzureFunctionToolDefinition toolDefinition && Name == toolDefinition.Name); | ||
|
|
||
| /// <inheritdoc/> | ||
| public override int GetHashCode() => InternalAzureFunction.GetHashCode(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.