Skip to content

Commit a6a4dfe

Browse files
Merge branch 'main' of https://github.com/openai/openai-dotnet into shreja/AddJsonPath
2 parents 0af181b + 9dd0906 commit a6a4dfe

26 files changed

+122
-122
lines changed

codegen/generator/src/OpenAI.Library.Plugin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20251002.1" />
11+
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20251003.1" />
1212
</ItemGroup>
1313

1414
<!-- Copy output to package dist path for local execution and -->

codegen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"@open-ai/plugin": "file:",
3232
"@azure-tools/typespec-client-generator-core": "0.60.0",
33-
"@typespec/http-client-csharp": "1.0.0-alpha.20251002.1",
33+
"@typespec/http-client-csharp": "1.0.0-alpha.20251003.1",
3434
"@typespec/http": "1.4.0",
3535
"@typespec/openapi": "1.4.0"
3636
},

docs/guides/images-vision/responses/analyze_images_passing_base64_string.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// Download an image as stream
1818
using var stream = await http.GetStreamAsync(imageUrl);
1919

20-
OpenAIResponse response1 = (OpenAIResponse)client.CreateResponse([
20+
OpenAIResponse response1 = client.CreateResponse([
2121
ResponseItem.CreateUserMessageItem([
2222
ResponseContentPart.CreateInputTextPart("What is in this image?"),
2323
ResponseContentPart.CreateInputImagePart(BinaryData.FromStream(stream), "image/png")
@@ -29,7 +29,7 @@
2929
// Download an image as byte array
3030
byte[] bytes = await http.GetByteArrayAsync(imageUrl);
3131

32-
OpenAIResponse response2 = (OpenAIResponse)client.CreateResponse([
32+
OpenAIResponse response2 = client.CreateResponse([
3333
ResponseItem.CreateUserMessageItem([
3434
ResponseContentPart.CreateInputTextPart("What is in this image?"),
3535
ResponseContentPart.CreateInputImagePart(BinaryData.FromBytes(bytes), "image/png")

docs/guides/images-vision/responses/analyze_images_passing_file.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
OpenAIFileClient files = new(key);
2323
OpenAIFile file = await files.UploadFileAsync(BinaryData.FromStream(stream), filename, FileUploadPurpose.Vision);
2424

25-
OpenAIResponse response = (OpenAIResponse)client.CreateResponse([
25+
OpenAIResponse response = client.CreateResponse([
2626
ResponseItem.CreateUserMessageItem([
2727
ResponseContentPart.CreateInputTextPart("what's in this image?"),
2828
ResponseContentPart.CreateInputImagePart(file.Id)

docs/guides/images-vision/responses/analyze_images_passing_url.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
Uri imageUrl = new("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg");
1515

16-
OpenAIResponse response = (OpenAIResponse)client.CreateResponse([
16+
OpenAIResponse response = client.CreateResponse([
1717
ResponseItem.CreateUserMessageItem([
1818
ResponseContentPart.CreateInputTextPart("What is in this image?"),
1919
ResponseContentPart.CreateInputImagePart(imageUrl)

docs/guides/text/responses/responses_fileinput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
OpenAIFileClient files = new(key);
1717
OpenAIFile file = files.UploadFile("draconomicon.pdf", FileUploadPurpose.UserData);
1818

19-
OpenAIResponse response = (OpenAIResponse)client.CreateResponse(
19+
OpenAIResponse response = client.CreateResponse(
2020
BinaryContent.Create(BinaryData.FromObjectAsJson(
2121
new {
2222
model = "gpt-4.1",

docs/guides/text/responses/responses_prompttemplate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
1212
OpenAIResponseClient client = new("gpt-4.1", key);
13-
OpenAIResponse response = (OpenAIResponse)client.CreateResponse(
13+
OpenAIResponse response = client.CreateResponse(
1414
BinaryContent.Create(BinaryData.FromObjectAsJson(
1515
new {
1616
model = "gpt-4.1",

docs/guides/tools-connectors-mcp/responses/approvals-always-require-approval.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
));
2020

2121
// STEP 1: Create response that requests tool call approval
22-
OpenAIResponse response1 = (OpenAIResponse)client.CreateResponse([
22+
OpenAIResponse response1 = client.CreateResponse([
2323
ResponseItem.CreateUserMessageItem([
2424
ResponseContentPart.CreateInputTextPart("Roll 2d4+1")
2525
])
@@ -29,7 +29,7 @@
2929

3030
// STEP 2: Approve the tool call request and get final response
3131
options.PreviousResponseId = response1.Id;
32-
OpenAIResponse response2 = (OpenAIResponse)client.CreateResponse([
32+
OpenAIResponse response2 = client.CreateResponse([
3333
ResponseItem.CreateMcpApprovalResponseItem(approvalRequestItem!.Id, approved: true),
3434
], options);
3535

docs/guides/tools-connectors-mcp/responses/approvals-never-require-approval.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
toolCallApprovalPolicy: new McpToolCallApprovalPolicy(GlobalMcpToolCallApprovalPolicy.NeverRequireApproval)
2020
));
2121

22-
OpenAIResponse response = (OpenAIResponse)client.CreateResponse([
22+
OpenAIResponse response = client.CreateResponse([
2323
ResponseItem.CreateUserMessageItem([
2424
ResponseContentPart.CreateInputTextPart("What transport protocols does the 2025-03-26 version of the MCP spec (modelcontextprotocol/modelcontextprotocol) support?")
2525
])

docs/guides/tools-connectors-mcp/responses/authentication.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
authorizationToken: authToken
2020
));
2121

22-
OpenAIResponse response = (OpenAIResponse)client.CreateResponse([
22+
OpenAIResponse response = client.CreateResponse([
2323
ResponseItem.CreateUserMessageItem([
2424
ResponseContentPart.CreateInputTextPart("Create a payment link for $20")
2525
])

0 commit comments

Comments
 (0)