Skip to content
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

8.2.0-beta Assistant #535

Merged
merged 38 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b5ade78
[ADD]: Added beta assistants API
Jan 2, 2024
03d5ac5
[BUGFIX] Fixed an issue with assistants API deletion failure
Jan 2, 2024
e7e4e30
[CHG] Resolved namespace conflicts in MessageContent
Jan 2, 2024
b6bde0d
[FIX] Fix naming error of AssistantsStatics
Jan 18, 2024
474e4db
Merge branch 'betalgo:master' into master
CongquanHu Jan 31, 2024
f5a7032
Merge branch 'betalgo:master' into master
CongquanHu Feb 7, 2024
7a4f5d3
Merge branch 'betalgo:master' into master
CongquanHu Feb 8, 2024
bfcaf80
Add flag to control console output color
kayhantolga Apr 11, 2024
947a55c
console color reverted to default
kayhantolga Apr 11, 2024
d775730
jsonl file converted to english
kayhantolga Apr 12, 2024
d2e4b55
Updated Endpoint providers
kayhantolga Apr 12, 2024
52e1c61
Code cleanup and some fixes.
kayhantolga Apr 14, 2024
2c61fbf
model updates
kayhantolga Apr 14, 2024
9f52ba4
Response Models updated
kayhantolga Apr 14, 2024
8cbb340
documentation typo fixes
kayhantolga Apr 15, 2024
85beb14
RequiredAction Cleanup
kayhantolga Apr 15, 2024
5ad4f61
Message response objects updated
kayhantolga Apr 15, 2024
47e335d
removed last error
kayhantolga Apr 15, 2024
74a93fa
removed unused ISystemFingerPrint
kayhantolga Apr 15, 2024
6553455
removed duplicated AssistantFileResponse
kayhantolga Apr 15, 2024
88f4be9
code cleanup
kayhantolga Apr 15, 2024
6963769
bug fixes and some cleanups
kayhantolga Apr 15, 2024
287328f
updated csproj
kayhantolga Apr 15, 2024
318c0b6
code cleanup
kayhantolga Apr 15, 2024
f3d1d84
Code Cleanup
kayhantolga Apr 15, 2024
a3622ec
playground fixes
kayhantolga Apr 15, 2024
b8f124c
Read me update
kayhantolga Apr 15, 2024
34a4920
moved some files
kayhantolga Apr 15, 2024
9506c3b
Fixed a bug in configuration
kayhantolga Apr 15, 2024
a4bf0b4
documentation update
kayhantolga Apr 15, 2024
27de0e3
Merge pull request #531 from betalgo/assistant-api
kayhantolga Apr 15, 2024
aab5a2d
readme update
kayhantolga Apr 15, 2024
25e6d62
Merge pull request #534 from betalgo/assistant-api
kayhantolga Apr 15, 2024
447e908
Readme update
kayhantolga Apr 15, 2024
0558005
resolved merge conflicts
kayhantolga Apr 16, 2024
83c6ffa
bug fixes after merge
kayhantolga Apr 16, 2024
3df7392
small update
kayhantolga Apr 16, 2024
0dcda0d
resolved merge conflicts
kayhantolga Apr 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace OpenAI.Playground;
namespace OpenAI.Playground.ExtensionsAndHelpers;

public static class ConsoleExtensions
{
public static void WriteLine(string value, ConsoleColor color)
public static void WriteLine(string? value, ConsoleColor color = ConsoleColor.Gray)
{
var defaultColor = Console.ForegroundColor;
Console.ForegroundColor = color;
Expand Down
16 changes: 16 additions & 0 deletions OpenAI.Playground/ExtensionsAndHelpers/StringExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Text.Json;

namespace OpenAI.Playground.ExtensionsAndHelpers;

public static class StringExtension
{
public static string? ToJson(this object? s)
{
return s == null ? null : JsonSerializer.Serialize(s);
}

public static T? D<T>(this string json) where T : class
{
return string.IsNullOrWhiteSpace(json) ? null : JsonSerializer.Deserialize<T>(json);
}
}
6 changes: 6 additions & 0 deletions OpenAI.Playground/OpenAI.Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
<None Update="ApiSettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleData\betterway_corp.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleData\betterway_corp.jsonl">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleData\BatchDataSampleFile.jsonl">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
20 changes: 18 additions & 2 deletions OpenAI.Playground/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
// It is in Beta version, if you don't want to use it just comment out below line.
serviceCollection.AddLaserCatEyesHttpClientListener();

//if you want to use beta services you have to set UseBeta to true. Otherwise, it will use the stable version of OpenAI apis.
serviceCollection.AddOpenAIService(r=>r.UseBeta = true);

serviceCollection.AddOpenAIService();
//serviceCollection.AddOpenAIService();
//// DeploymentId and ResourceName are only for Azure OpenAI. If you want to use Azure OpenAI services you have to set Provider type To Azure.
//serviceCollection.AddOpenAIService(options =>
//{
Expand All @@ -39,9 +41,22 @@
// | / \ / \ | \ /) | ( \ /o\ / ) | (\ / | / \ / \ |
// |-----------------------------------------------------------------------|

//await ChatCompletionTestHelper.RunSimpleChatCompletionTest(sdk);
await ChatCompletionTestHelper.RunSimpleChatCompletionTest(sdk);
//await ChatCompletionTestHelper.RunSimpleCompletionStreamTest(sdk);


//Assistants - BETA
//await AssistantTestHelper.RunAssistantApiTest(sdk);
//await AssistantTestHelper.RunHowAssistantsWorkTest(sdk);

//await MessageTestHelper.RunMessageCreateTest(sdk);

//await ThreadTestHelper.RunThreadCreateTest(sdk);
//await ThreadTestHelper.RunThreadRetrieveTest(sdk);

//await RunTestHelper.RunRunCreateTest(sdk);
//await RunTestHelper.RunRunCancelTest(sdk);

// Vision
//await VisionTestHelper.RunSimpleVisionTest(sdk);
//await VisionTestHelper.RunSimpleVisionStreamTest(sdk);
Expand All @@ -51,6 +66,7 @@
//await ChatCompletionTestHelper.RunChatFunctionCallTest(sdk);
//await ChatCompletionTestHelper.RunChatFunctionCallTestAsStream(sdk);
await BatchTestHelper.RunBatchOperationsTest(sdk);

// Whisper
//await AudioTestHelper.RunSimpleAudioCreateTranscriptionTest(sdk);
//await AudioTestHelper.RunSimpleAudioCreateTranslationTest(sdk);
Expand Down
2 changes: 2 additions & 0 deletions OpenAI.Playground/SampleData/betterway_corp.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Company Overview,Company Address
"Please refer to Betterway Supply Chain Co., Ltd. for details.","Betterway Supply Chain Co., Ltd. is located in Jiangsu Province, Nanjing City, Xianlin District, No. 615 on the Eighth Street. Established in 2011, it is a company specializing in the provision of innovative supply chain services, covering the whole country and overseas, mainly in finance, insurance, telecommunications, technology, health, education, agriculture, tourism, automotive, new materials, Australia, Brazil, etc."
1 change: 1 addition & 0 deletions OpenAI.Playground/SampleData/betterway_corp.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"messages":[{"role":"system","content":"You are a professional assistant providing logistics supply chain services"}, {"role":"user","content":"Where exactly is Zhejiang Jiacheng Supply Chain Co., Ltd. located?"}, {"role":"assistant","content":"Zhejiang Jiacheng Supply Chain Co., Ltd. is located at No. 615, Bayi North Street, Wucheng District, Jinhua City, Zhejiang Province, Jiacheng International Business Center"}, {"role":"user","content":"Please introduce Zhejiang Jiacheng Supply Chain Company."}, {"role":"assistant","content":"Zhejiang Jiacheng Supply Chain Company was founded in 2011 and is an innovative supply chain service enterprise focusing on cross-border logistics. Its subsidiaries are located throughout the country and overseas, mainly involving Jinhua, Yiwu, Ningbo, Shenyang, Tianjin, Qingdao, Jinan, Suzhou, Chengdu, Singapore, Germany, Russia and other places."}]}
Loading
Loading