-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added `Tool` call and `Function` call Utilities and helper methods - Added `FunctionAttribute` to decorate methods to be identified and used in function calling - `Chat.Message.ToolCalls` can be directly invoked using `Function.Invoke()` or `Function.InvokeAsync(CancellationToken)` - Assistant tool call outputs can be easily generated using `assistnat.GetToolOutputAsync(run.RequiredAction.SubmitToolOutputs.ToolCalls)` - Check updated docs for more details and examples - Fixed `ChatRequest` seed parameter not being set correctly when using tools
- Loading branch information
1 parent
8e99b07
commit 192c765
Showing
43 changed files
with
706 additions
and
368 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,40 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using NUnit.Framework; | ||
using System; | ||
|
||
namespace OpenAI.Tests | ||
{ | ||
internal class TestFixture_00_02_Extensions | ||
{ | ||
[Test] | ||
public void Test_01_Tools() | ||
{ | ||
var tools = Tool.GetAllAvailableTools(); | ||
|
||
for (var i = 0; i < tools.Count; i++) | ||
{ | ||
var tool = tools[i]; | ||
|
||
if (tool.Type != "function") | ||
{ | ||
Console.Write($" \"{tool.Type}\""); | ||
} | ||
else | ||
{ | ||
Console.Write($" \"{tool.Function.Name}\""); | ||
} | ||
|
||
if (tool.Function?.Parameters != null) | ||
{ | ||
Console.Write($": {tool.Function.Parameters}"); | ||
} | ||
|
||
if (i < tools.Count - 1) | ||
{ | ||
Console.Write(",\n"); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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.
This file contains 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 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 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 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 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 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 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 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.