Skip to content

Commit 023d691

Browse files
committed
fb
1 parent 2b6938d commit 023d691

18 files changed

+116
-117
lines changed

api/OpenAI.net8.0.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4716,8 +4716,8 @@ public class ComputerTool : ResponseTool, IJsonModel<ComputerTool>, IPersistable
47164716
public override readonly string ToString();
47174717
}
47184718
[Experimental("OPENAI001")]
4719-
public class FileCitationAnnotation : ResponseMessageAnnotation, IJsonModel<FileCitationAnnotation>, IPersistableModel<FileCitationAnnotation> {
4720-
public FileCitationAnnotation(string fileId, int index);
4719+
public class FileCitationMessageAnnotation : ResponseMessageAnnotation, IJsonModel<FileCitationMessageAnnotation>, IPersistableModel<FileCitationMessageAnnotation> {
4720+
public FileCitationMessageAnnotation(string fileId, int index);
47214721
public string FileId { get; set; }
47224722
public int Index { get; set; }
47234723
protected override ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
@@ -4726,8 +4726,8 @@ public class FileCitationAnnotation : ResponseMessageAnnotation, IJsonModel<File
47264726
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
47274727
}
47284728
[Experimental("OPENAI001")]
4729-
public class FilePathAnnotation : ResponseMessageAnnotation, IJsonModel<FilePathAnnotation>, IPersistableModel<FilePathAnnotation> {
4730-
public FilePathAnnotation(string fileId, int index);
4729+
public class FilePathMessageAnnotation : ResponseMessageAnnotation, IJsonModel<FilePathMessageAnnotation>, IPersistableModel<FilePathMessageAnnotation> {
4730+
public FilePathMessageAnnotation(string fileId, int index);
47314731
public string FileId { get; set; }
47324732
public int Index { get; set; }
47334733
protected override ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
@@ -5634,12 +5634,12 @@ public class StreamingResponseWebSearchCallSearchingUpdate : StreamingResponseUp
56345634
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
56355635
}
56365636
[Experimental("OPENAI001")]
5637-
public class UrlCitationAnnotation : ResponseMessageAnnotation, IJsonModel<UrlCitationAnnotation>, IPersistableModel<UrlCitationAnnotation> {
5638-
public UrlCitationAnnotation(Uri url, int startIndex, int endIndex, string title);
5637+
public class UriCitationMessageAnnotation : ResponseMessageAnnotation, IJsonModel<UriCitationMessageAnnotation>, IPersistableModel<UriCitationMessageAnnotation> {
5638+
public UriCitationMessageAnnotation(Uri uri, int startIndex, int endIndex, string title);
56395639
public int EndIndex { get; set; }
56405640
public int StartIndex { get; set; }
56415641
public string Title { get; set; }
5642-
public Uri Url { get; set; }
5642+
public Uri Uri { get; set; }
56435643
protected override ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
56445644
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
56455645
protected override ResponseMessageAnnotation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);

api/OpenAI.netstandard2.0.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4141,17 +4141,17 @@ public class ComputerTool : ResponseTool, IJsonModel<ComputerTool>, IPersistable
41414141
public static bool operator !=(ComputerToolEnvironment left, ComputerToolEnvironment right);
41424142
public override readonly string ToString();
41434143
}
4144-
public class FileCitationAnnotation : ResponseMessageAnnotation, IJsonModel<FileCitationAnnotation>, IPersistableModel<FileCitationAnnotation> {
4145-
public FileCitationAnnotation(string fileId, int index);
4144+
public class FileCitationMessageAnnotation : ResponseMessageAnnotation, IJsonModel<FileCitationMessageAnnotation>, IPersistableModel<FileCitationMessageAnnotation> {
4145+
public FileCitationMessageAnnotation(string fileId, int index);
41464146
public string FileId { get; set; }
41474147
public int Index { get; set; }
41484148
protected override ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
41494149
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
41504150
protected override ResponseMessageAnnotation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
41514151
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
41524152
}
4153-
public class FilePathAnnotation : ResponseMessageAnnotation, IJsonModel<FilePathAnnotation>, IPersistableModel<FilePathAnnotation> {
4154-
public FilePathAnnotation(string fileId, int index);
4153+
public class FilePathMessageAnnotation : ResponseMessageAnnotation, IJsonModel<FilePathMessageAnnotation>, IPersistableModel<FilePathMessageAnnotation> {
4154+
public FilePathMessageAnnotation(string fileId, int index);
41554155
public string FileId { get; set; }
41564156
public int Index { get; set; }
41574157
protected override ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
@@ -4976,12 +4976,12 @@ public class StreamingResponseWebSearchCallSearchingUpdate : StreamingResponseUp
49764976
protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
49774977
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
49784978
}
4979-
public class UrlCitationAnnotation : ResponseMessageAnnotation, IJsonModel<UrlCitationAnnotation>, IPersistableModel<UrlCitationAnnotation> {
4980-
public UrlCitationAnnotation(Uri url, int startIndex, int endIndex, string title);
4979+
public class UriCitationMessageAnnotation : ResponseMessageAnnotation, IJsonModel<UriCitationMessageAnnotation>, IPersistableModel<UriCitationMessageAnnotation> {
4980+
public UriCitationMessageAnnotation(Uri uri, int startIndex, int endIndex, string title);
49814981
public int EndIndex { get; set; }
49824982
public int StartIndex { get; set; }
49834983
public string Title { get; set; }
4984-
public Uri Url { get; set; }
4984+
public Uri Uri { get; set; }
49854985
protected override ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
49864986
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
49874987
protected override ResponseMessageAnnotation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);

src/Custom/Responses/FileCitationAnnotation.cs renamed to src/Custom/Responses/Annotations/FileCitationMessageAnnotation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
// CUSTOM:
44
// - Renamed.
55
[CodeGenType("AnnotationFileCitation")]
6-
public partial class FileCitationAnnotation
6+
public partial class FileCitationMessageAnnotation
77
{
88
}

src/Custom/Responses/FilePathAnnotation.cs renamed to src/Custom/Responses/Annotations/FilePathMessageAnnotation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
// CUSTOM:
44
// - Renamed.
55
[CodeGenType("AnnotationFilePath")]
6-
public partial class FilePathAnnotation
6+
public partial class FilePathMessageAnnotation
77
{
88
}

src/Custom/Responses/ResponseMessageAnnotation.cs renamed to src/Custom/Responses/Annotations/ResponseMessageAnnotation.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
using System.Diagnostics.CodeAnalysis;
3-
41
namespace OpenAI.Responses;
52

63
// CUSTOM:

src/Custom/Responses/ResponseMessageAnnotationKind.cs renamed to src/Custom/Responses/Annotations/ResponseMessageAnnotationKind.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ public enum ResponseMessageAnnotationKind
1717
FilePath,
1818

1919
ContainerFileCitation
20-
}
20+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace OpenAI.Responses;
4+
5+
// CUSTOM:
6+
// - Renamed.
7+
[CodeGenType("AnnotationUrlCitation")]
8+
public partial class UriCitationMessageAnnotation
9+
{
10+
[CodeGenMember("Url")]
11+
public Uri Uri { get; set; }
12+
}

src/Custom/Responses/UrlCitationAnnotation.cs

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

src/Generated/Models/OpenAIContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ namespace OpenAI
9696
[ModelReaderWriterBuildable(typeof(EmbeddingGenerationOptions))]
9797
[ModelReaderWriterBuildable(typeof(EmbeddingTokenUsage))]
9898
[ModelReaderWriterBuildable(typeof(FileChunkingStrategy))]
99-
[ModelReaderWriterBuildable(typeof(FileCitationAnnotation))]
99+
[ModelReaderWriterBuildable(typeof(FileCitationMessageAnnotation))]
100100
[ModelReaderWriterBuildable(typeof(FileDeletionResult))]
101101
[ModelReaderWriterBuildable(typeof(FileFromStoreRemovalResult))]
102-
[ModelReaderWriterBuildable(typeof(FilePathAnnotation))]
102+
[ModelReaderWriterBuildable(typeof(FilePathMessageAnnotation))]
103103
[ModelReaderWriterBuildable(typeof(FileSearchCallResponseItem))]
104104
[ModelReaderWriterBuildable(typeof(FileSearchCallResult))]
105105
[ModelReaderWriterBuildable(typeof(FileSearchRankingOptions))]
@@ -784,7 +784,7 @@ namespace OpenAI
784784
[ModelReaderWriterBuildable(typeof(UnknownRunStepDetailsToolCallsCodeObjectCodeInterpreterOutputsObject))]
785785
[ModelReaderWriterBuildable(typeof(UnknownRunStepDetailsToolCallsObjectToolCallsObject))]
786786
[ModelReaderWriterBuildable(typeof(UnknownRunStepObjectStepDetails))]
787-
[ModelReaderWriterBuildable(typeof(UrlCitationAnnotation))]
787+
[ModelReaderWriterBuildable(typeof(UriCitationMessageAnnotation))]
788788
[ModelReaderWriterBuildable(typeof(UserChatMessage))]
789789
[ModelReaderWriterBuildable(typeof(ValidateGraderRequest))]
790790
[ModelReaderWriterBuildable(typeof(ValidateGraderResponse))]

src/Generated/Models/Responses/FileCitationAnnotation.Serialization.cs renamed to src/Generated/Models/Responses/FileCitationMessageAnnotation.Serialization.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
namespace OpenAI.Responses
1212
{
13-
public partial class FileCitationAnnotation : IJsonModel<FileCitationAnnotation>
13+
public partial class FileCitationMessageAnnotation : IJsonModel<FileCitationMessageAnnotation>
1414
{
15-
internal FileCitationAnnotation() : this(ResponseMessageAnnotationKind.FileCitation, null, null, default)
15+
internal FileCitationMessageAnnotation() : this(ResponseMessageAnnotationKind.FileCitation, null, null, default)
1616
{
1717
}
1818

19-
void IJsonModel<FileCitationAnnotation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
19+
void IJsonModel<FileCitationMessageAnnotation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
2020
{
2121
writer.WriteStartObject();
2222
JsonModelWriteCore(writer, options);
@@ -25,10 +25,10 @@ void IJsonModel<FileCitationAnnotation>.Write(Utf8JsonWriter writer, ModelReader
2525

2626
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
2727
{
28-
string format = options.Format == "W" ? ((IPersistableModel<FileCitationAnnotation>)this).GetFormatFromOptions(options) : options.Format;
28+
string format = options.Format == "W" ? ((IPersistableModel<FileCitationMessageAnnotation>)this).GetFormatFromOptions(options) : options.Format;
2929
if (format != "J")
3030
{
31-
throw new FormatException($"The model {nameof(FileCitationAnnotation)} does not support writing '{format}' format.");
31+
throw new FormatException($"The model {nameof(FileCitationMessageAnnotation)} does not support writing '{format}' format.");
3232
}
3333
base.JsonModelWriteCore(writer, options);
3434
if (_additionalBinaryDataProperties?.ContainsKey("file_id") != true)
@@ -43,20 +43,20 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri
4343
}
4444
}
4545

46-
FileCitationAnnotation IJsonModel<FileCitationAnnotation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (FileCitationAnnotation)JsonModelCreateCore(ref reader, options);
46+
FileCitationMessageAnnotation IJsonModel<FileCitationMessageAnnotation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (FileCitationMessageAnnotation)JsonModelCreateCore(ref reader, options);
4747

4848
protected override ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
4949
{
50-
string format = options.Format == "W" ? ((IPersistableModel<FileCitationAnnotation>)this).GetFormatFromOptions(options) : options.Format;
50+
string format = options.Format == "W" ? ((IPersistableModel<FileCitationMessageAnnotation>)this).GetFormatFromOptions(options) : options.Format;
5151
if (format != "J")
5252
{
53-
throw new FormatException($"The model {nameof(FileCitationAnnotation)} does not support reading '{format}' format.");
53+
throw new FormatException($"The model {nameof(FileCitationMessageAnnotation)} does not support reading '{format}' format.");
5454
}
5555
using JsonDocument document = JsonDocument.ParseValue(ref reader);
56-
return DeserializeFileCitationAnnotation(document.RootElement, options);
56+
return DeserializeFileCitationMessageAnnotation(document.RootElement, options);
5757
}
5858

59-
internal static FileCitationAnnotation DeserializeFileCitationAnnotation(JsonElement element, ModelReaderWriterOptions options)
59+
internal static FileCitationMessageAnnotation DeserializeFileCitationMessageAnnotation(JsonElement element, ModelReaderWriterOptions options)
6060
{
6161
if (element.ValueKind == JsonValueKind.Null)
6262
{
@@ -86,40 +86,40 @@ internal static FileCitationAnnotation DeserializeFileCitationAnnotation(JsonEle
8686
// Plugin customization: remove options.Format != "W" check
8787
additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText()));
8888
}
89-
return new FileCitationAnnotation(kind, additionalBinaryDataProperties, fileId, index);
89+
return new FileCitationMessageAnnotation(kind, additionalBinaryDataProperties, fileId, index);
9090
}
9191

92-
BinaryData IPersistableModel<FileCitationAnnotation>.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options);
92+
BinaryData IPersistableModel<FileCitationMessageAnnotation>.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options);
9393

9494
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options)
9595
{
96-
string format = options.Format == "W" ? ((IPersistableModel<FileCitationAnnotation>)this).GetFormatFromOptions(options) : options.Format;
96+
string format = options.Format == "W" ? ((IPersistableModel<FileCitationMessageAnnotation>)this).GetFormatFromOptions(options) : options.Format;
9797
switch (format)
9898
{
9999
case "J":
100100
return ModelReaderWriter.Write(this, options, OpenAIContext.Default);
101101
default:
102-
throw new FormatException($"The model {nameof(FileCitationAnnotation)} does not support writing '{options.Format}' format.");
102+
throw new FormatException($"The model {nameof(FileCitationMessageAnnotation)} does not support writing '{options.Format}' format.");
103103
}
104104
}
105105

106-
FileCitationAnnotation IPersistableModel<FileCitationAnnotation>.Create(BinaryData data, ModelReaderWriterOptions options) => (FileCitationAnnotation)PersistableModelCreateCore(data, options);
106+
FileCitationMessageAnnotation IPersistableModel<FileCitationMessageAnnotation>.Create(BinaryData data, ModelReaderWriterOptions options) => (FileCitationMessageAnnotation)PersistableModelCreateCore(data, options);
107107

108108
protected override ResponseMessageAnnotation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options)
109109
{
110-
string format = options.Format == "W" ? ((IPersistableModel<FileCitationAnnotation>)this).GetFormatFromOptions(options) : options.Format;
110+
string format = options.Format == "W" ? ((IPersistableModel<FileCitationMessageAnnotation>)this).GetFormatFromOptions(options) : options.Format;
111111
switch (format)
112112
{
113113
case "J":
114114
using (JsonDocument document = JsonDocument.Parse(data))
115115
{
116-
return DeserializeFileCitationAnnotation(document.RootElement, options);
116+
return DeserializeFileCitationMessageAnnotation(document.RootElement, options);
117117
}
118118
default:
119-
throw new FormatException($"The model {nameof(FileCitationAnnotation)} does not support reading '{options.Format}' format.");
119+
throw new FormatException($"The model {nameof(FileCitationMessageAnnotation)} does not support reading '{options.Format}' format.");
120120
}
121121
}
122122

123-
string IPersistableModel<FileCitationAnnotation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
123+
string IPersistableModel<FileCitationMessageAnnotation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
124124
}
125125
}

0 commit comments

Comments
 (0)