Skip to content

Commit 0fff870

Browse files
committed
Use AutoSDK CLI for docs sync
1 parent 631af2f commit 0fff870

31 files changed

Lines changed: 77 additions & 560 deletions

.github/workflows/mkdocs.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- 'docs/**'
88
- 'mkdocs.yml'
99
- 'examples/**'
10-
- 'src/helpers/GenerateDocs/**'
10+
- 'autosdk.docs.json'
1111
- 'src/tests/OpenAI.IntegrationTests/Examples/**'
1212
- '.github/workflows/mkdocs.yml'
1313

@@ -33,8 +33,16 @@ jobs:
3333
- name: Setup Pages
3434
uses: actions/configure-pages@v5
3535

36+
- name: Setup .NET
37+
uses: actions/setup-dotnet@v4
38+
with:
39+
dotnet-version: 10.0.x
40+
41+
- name: Install AutoSDK CLI
42+
run: dotnet tool install --global autosdk.cli --prerelease
43+
3644
- name: Generate docs
37-
run: dotnet run --project src/helpers/GenerateDocs/GenerateDocs.csproj .
45+
run: autosdk docs sync .
3846

3947
- name: Build with MkDocs
4048
run: |

OpenAI.slnx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Solution>
22
<Folder Name="/helpers/">
3-
<Project Path="src/helpers/GenerateDocs/GenerateDocs.csproj" />
43
<Project Path="src/helpers/TrimmingHelper/TrimmingHelper.csproj" />
54
</Folder>
65
<Folder Name="/libs/">

docs/samples/Assistants.AllTools.md

Lines changed: 0 additions & 197 deletions
This file was deleted.

docs/samples/Assistants.AssistantsWithVision.md

Lines changed: 0 additions & 93 deletions
This file was deleted.

docs/samples/Assistants.FunctionCalling.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
```csharp
2-
using var api = GetAuthenticatedClient();
2+
using var api = new OpenAiClient(apiKey);
33

44
var service = new FunctionCallingService();
55
IList<ChatCompletionTool> tools = service.AsTools().AsOpenAiTools();
66

77
AssistantObject assistant = await api.Assistants.CreateAssistantAsync(
8-
model: CreateAssistantRequestModel.Gpt4o,
8+
model: AssistantSupportedModels.Gpt4o,
99
name: "Example: Function Calling",
1010
instructions: "Don't make assumptions about what values to plug into functions."
1111
+ " Ask for clarification if a user request is ambiguous.",
12-
tools: tools.Select(x => new ToolsItem2(new AssistantToolsFunction
12+
tools: tools.Select(x => new global::tryAGI.OpenAI.OneOf<global::tryAGI.OpenAI.AssistantToolsCode, global::tryAGI.OpenAI.AssistantToolsFileSearch, global::tryAGI.OpenAI.AssistantToolsFunction>(new AssistantToolsFunction
1313
{
1414
Function = x.Function,
1515
})).ToArray());
@@ -61,33 +61,33 @@ if (run.Status == RunObjectStatus.Completed)
6161
foreach (MessageObject message in messages.Data)
6262
{
6363
Console.WriteLine($"[{message.Role.ToString().ToUpper()}]: ");
64-
foreach (ContentItem2 contentItem in message.Content)
64+
foreach (global::tryAGI.OpenAI.OneOf<global::tryAGI.OpenAI.MessageContentImageFileObject, global::tryAGI.OpenAI.MessageContentImageUrlObject, global::tryAGI.OpenAI.MessageContentTextObject, global::tryAGI.OpenAI.MessageContentRefusalObject> contentItem in message.Content)
6565
{
66-
if (contentItem.MessageImageFileObject is {} imageFile)
66+
if (contentItem.ImageFile is {} imageFile)
6767
{
6868
Console.WriteLine($" <Image File ID> {imageFile.ImageFile.FileId}");
6969
}
70-
if (contentItem.MessageImageUrlObject is {} imageUrl)
70+
if (contentItem.ImageUrl is {} imageUrl)
7171
{
7272
Console.WriteLine($" <Image URL> {imageUrl.ImageUrl.Url}");
7373
}
74-
if (contentItem.MessageTextObject is {} text)
74+
if (contentItem.Text is {} text)
7575
{
7676
Console.WriteLine($"{text.Text.Value}");
77-
77+
7878
// Include annotations, if any.
7979
if (text.Text.Annotations.Count > 0)
8080
{
8181
Console.WriteLine();
8282
foreach (AnnotationsItem annotation in text.Text.Annotations)
8383
{
84-
if (annotation.MessageContentTextFileCitationObject is {} fileCitation)
84+
if (annotation.FileCitation is {} fileCitation)
8585
{
8686
Console.WriteLine($"* File citation, file ID: {fileCitation.FileCitation.FileId}");
8787
Console.WriteLine($"* Text to replace: {fileCitation.Text}");
8888
Console.WriteLine($"* Message content index range: {fileCitation.StartIndex}-{fileCitation.EndIndex}");
8989
}
90-
if (annotation.MessageContentTextFilePathObject is {} filePath)
90+
if (annotation.FilePath is {} filePath)
9191
{
9292
Console.WriteLine($"* File output, new file ID: {filePath.FilePath.FileId}");
9393
Console.WriteLine($"* Text to replace: {filePath.Text}");
@@ -96,7 +96,7 @@ if (run.Status == RunObjectStatus.Completed)
9696
}
9797
}
9898
}
99-
if (contentItem.MessageRefusalObject is {} refusal)
99+
if (contentItem.Refusal is {} refusal)
100100
{
101101
Console.WriteLine($"Refusal: {refusal.Refusal}");
102102
}

0 commit comments

Comments
 (0)