Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -106,6 +106,7 @@ public class ResultsItemJsonConverter : global::System.Text.Json.Serialization.J
if (__jsonProps.Contains("line_item")) __score8++;
if (__jsonProps.Contains("object")) __score8++;
if (__jsonProps.Contains("project_id")) __score8++;
if (__jsonProps.Contains("quantity")) __score8++;
var __bestScore = 0;
var __bestIndex = -1;
if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public sealed partial class ChatCompletionTokenLogprob
public global::System.Collections.Generic.IList<long>? Bytes { get; set; }

/// <summary>
/// List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
/// List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("top_logprobs")]
[global::System.Text.Json.Serialization.JsonRequired]
Expand All @@ -51,7 +51,7 @@ public sealed partial class ChatCompletionTokenLogprob
/// The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
/// </param>
/// <param name="topLogprobs">
/// List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
/// List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.
/// </param>
/// <param name="bytes"></param>
#if NET7_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public sealed partial class CostsResult
[global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")]
public string? ApiKeyId { get; set; }

/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("quantity")]
public double? Quantity { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -55,6 +61,7 @@ public sealed partial class CostsResult
/// <param name="lineItem"></param>
/// <param name="projectId"></param>
/// <param name="apiKeyId"></param>
/// <param name="quantity"></param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand All @@ -63,13 +70,15 @@ public CostsResult(
global::tryAGI.OpenAI.CostsResultAmount? amount,
string? lineItem,
string? projectId,
string? apiKeyId)
string? apiKeyId,
double? quantity)
{
this.Object = @object;
this.Amount = amount;
this.LineItem = lineItem;
this.ProjectId = projectId;
this.ApiKeyId = apiKeyId;
this.Quantity = quantity;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace tryAGI.OpenAI
{
public sealed partial class CostsResultQuantity
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::tryAGI.OpenAI.CostsResultQuantity? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::tryAGI.OpenAI.CostsResultQuantity),
jsonSerializerContext) as global::tryAGI.OpenAI.CostsResultQuantity;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::tryAGI.OpenAI.CostsResultQuantity? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::tryAGI.OpenAI.CostsResultQuantity>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.CostsResultQuantity?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::tryAGI.OpenAI.CostsResultQuantity),
jsonSerializerContext).ConfigureAwait(false)) as global::tryAGI.OpenAI.CostsResultQuantity;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.CostsResultQuantity?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::tryAGI.OpenAI.CostsResultQuantity?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#nullable enable

namespace tryAGI.OpenAI
{
/// <summary>
///
/// </summary>
public sealed partial class CostsResultQuantity
{

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ public sealed partial class CreateChatCompletionRequestVariant2
public global::tryAGI.OpenAI.CreateChatCompletionRequestVariant2WebSearchOptions? WebSearchOptions { get; set; }

/// <summary>
/// An integer between 0 and 20 specifying the number of most likely tokens to<br/>
/// return at each token position, each with an associated log probability.<br/>
/// An integer between 0 and 20 specifying the maximum number of most likely<br/>
/// tokens to return at each token position, each with an associated log<br/>
/// probability. In some cases, the number of returned tokens may be fewer than<br/>
/// requested.<br/>
/// `logprobs` must be set to `true` if this parameter is used.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("top_logprobs")]
Expand Down Expand Up @@ -304,8 +306,10 @@ public sealed partial class CreateChatCompletionRequestVariant2
/// Learn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).
/// </param>
/// <param name="topLogprobs">
/// An integer between 0 and 20 specifying the number of most likely tokens to<br/>
/// return at each token position, each with an associated log probability.<br/>
/// An integer between 0 and 20 specifying the maximum number of most likely<br/>
/// tokens to return at each token position, each with an associated log<br/>
/// probability. In some cases, the number of returned tokens may be fewer than<br/>
/// requested.<br/>
/// `logprobs` must be set to `true` if this parameter is used.
/// </param>
/// <param name="responseFormat">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ namespace tryAGI.OpenAI
public sealed partial class CreateModelResponsePropertiesVariant2
{
/// <summary>
/// An integer between 0 and 20 specifying the number of most likely tokens to<br/>
/// return at each token position, each with an associated log probability.
/// An integer between 0 and 20 specifying the maximum number of most likely<br/>
/// tokens to return at each token position, each with an associated log<br/>
/// probability. In some cases, the number of returned tokens may be fewer than<br/>
/// requested.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("top_logprobs")]
public int? TopLogprobs { get; set; }
Expand All @@ -25,8 +27,10 @@ public sealed partial class CreateModelResponsePropertiesVariant2
/// Initializes a new instance of the <see cref="CreateModelResponsePropertiesVariant2" /> class.
/// </summary>
/// <param name="topLogprobs">
/// An integer between 0 and 20 specifying the number of most likely tokens to<br/>
/// return at each token position, each with an associated log probability.
/// An integer between 0 and 20 specifying the maximum number of most likely<br/>
/// tokens to return at each token position, each with an associated log<br/>
/// probability. In some cases, the number of returned tokens may be fewer than<br/>
/// requested.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed partial class ResponseLogProb
public required double Logprob { get; set; }

/// <summary>
/// The log probability of the top 20 most likely tokens.
/// The log probabilities of up to 20 of the most likely tokens.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("top_logprobs")]
public global::System.Collections.Generic.IList<global::tryAGI.OpenAI.ResponseLogProbTopLogprob>? TopLogprobs { get; set; }
Expand All @@ -46,7 +46,7 @@ public sealed partial class ResponseLogProb
/// The log probability of this token.
/// </param>
/// <param name="topLogprobs">
/// The log probability of the top 20 most likely tokens.
/// The log probabilities of up to 20 of the most likely tokens.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
Expand Down
58 changes: 41 additions & 17 deletions src/libs/tryAGI.OpenAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15691,7 +15691,8 @@ paths:
},
"line_item": null,
"project_id": null,
"api_key_id": null
"api_key_id": null,
"quantity": null
}
]
}
Expand Down Expand Up @@ -41271,8 +41272,8 @@ components:
top_logprobs:
description: >-
List of the most likely tokens and their log probability, at this
token position. In rare cases, there may be fewer than the number of
requested `top_logprobs` returned.
token position. The number of entries may be fewer than the
requested `top_logprobs`.
type: array
items:
type: object
Expand Down Expand Up @@ -42177,6 +42178,13 @@ components:
When `group_by=api_key_id`, this field provides the API Key ID
of the grouped costs result.
- type: 'null'
quantity:
anyOf:
- type: number
description: >-
When `group_by=line_item`, this field provides the quantity of
the grouped costs result.
- type: 'null'
required:
- object
x-oaiMeta:
Expand All @@ -42189,7 +42197,8 @@ components:
"currency": "usd"
},
"line_item": "Image models",
"project_id": "proj_abc"
"project_id": "proj_abc",
"quantity": 10000
}
CreateAssistantRequest:
type: object
Expand Down Expand Up @@ -42515,11 +42524,16 @@ components:
$ref: '#/components/schemas/WebSearchContextSize'
top_logprobs:
description: >
An integer between 0 and 20 specifying the number of most likely
tokens to
An integer between 0 and 20 specifying the maximum number of
most likely

tokens to return at each token position, each with an associated
log

return at each token position, each with an associated log
probability.
probability. In some cases, the number of returned tokens may be
fewer than

requested.

`logprobs` must be set to `true` if this parameter is used.
type: integer
Expand Down Expand Up @@ -45114,11 +45128,16 @@ components:
properties:
top_logprobs:
description: >
An integer between 0 and 20 specifying the number of most likely
tokens to
An integer between 0 and 20 specifying the maximum number of
most likely

tokens to return at each token position, each with an associated
log

return at each token position, each with an associated log
probability.
probability. In some cases, the number of returned tokens may be
fewer than

requested.
type: integer
minimum: 0
maximum: 20
Expand Down Expand Up @@ -53800,11 +53819,16 @@ components:
top_logprobs:
anyOf:
- description: >
An integer between 0 and 20 specifying the number of most likely
tokens to
An integer between 0 and 20 specifying the maximum number of
most likely

tokens to return at each token position, each with an associated
log

probability. In some cases, the number of returned tokens may be
fewer than

return at each token position, each with an associated log
probability.
requested.
type: integer
minimum: 0
maximum: 20
Expand Down Expand Up @@ -67046,7 +67070,7 @@ components:
type: number
top_logprobs:
description: |
The log probability of the top 20 most likely tokens.
The log probabilities of up to 20 of the most likely tokens.
type: array
items:
type: object
Expand Down
Loading