Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 12, 2024
1 parent ccc6429 commit fa458f4
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ public partial interface IPromptsClient
/// <param name="artifact"></param>
/// <param name="artifactLength"></param>
/// <param name="readingLevel"></param>
/// <param name="customAction"></param>
/// <param name="templateFormat"></param>
/// <param name="secrets"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<string> PromptCanvasAsync(
global::System.Collections.Generic.IList<global::LangSmith.MessagesItem> messages,
global::LangSmith.PlaygroundPromptCanvasPayloadTemplateFormat templateFormat,
global::System.Collections.Generic.Dictionary<string, string> secrets,
global::LangSmith.Highlight? highlighted = default,
global::LangSmith.Artifact? artifact = default,
global::LangSmith.PlaygroundPromptCanvasPayloadArtifactLength? artifactLength = default,
global::LangSmith.PlaygroundPromptCanvasPayloadReadingLevel? readingLevel = default,
string? customAction = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public sealed partial class PlaygroundPromptCanvasPayload
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::LangSmith.JsonConverters.PlaygroundPromptCanvasPayloadReadingLevelJsonConverter))]
public global::LangSmith.PlaygroundPromptCanvasPayloadReadingLevel? ReadingLevel { get; set; }

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

/// <summary>
///
/// </summary>
Expand All @@ -49,6 +55,13 @@ public sealed partial class PlaygroundPromptCanvasPayload
[global::System.Text.Json.Serialization.JsonRequired]
public required global::LangSmith.PlaygroundPromptCanvasPayloadTemplateFormat TemplateFormat { get; set; }

/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("secrets")]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.Collections.Generic.Dictionary<string, string> Secrets { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@

#nullable enable

namespace LangSmith
{
/// <summary>
///
/// </summary>
public sealed partial class PlaygroundPromptCanvasPayloadSecrets
{

/// <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>();


/// <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::LangSmith.PlaygroundPromptCanvasPayloadSecrets? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::LangSmith.PlaygroundPromptCanvasPayloadSecrets),
jsonSerializerContext) as global::LangSmith.PlaygroundPromptCanvasPayloadSecrets;
}

/// <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::LangSmith.PlaygroundPromptCanvasPayloadSecrets? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::LangSmith.PlaygroundPromptCanvasPayloadSecrets>(
json,
jsonSerializerOptions);
}

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

/// <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::LangSmith.PlaygroundPromptCanvasPayloadSecrets?> FromJsonStream(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::LangSmith.PlaygroundPromptCanvasPayloadSecrets?>(
jsonStream,
jsonSerializerOptions);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,20 @@ partial void ProcessPromptCanvasResponseContent(
/// <param name="artifact"></param>
/// <param name="artifactLength"></param>
/// <param name="readingLevel"></param>
/// <param name="customAction"></param>
/// <param name="templateFormat"></param>
/// <param name="secrets"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<string> PromptCanvasAsync(
global::System.Collections.Generic.IList<global::LangSmith.MessagesItem> messages,
global::LangSmith.PlaygroundPromptCanvasPayloadTemplateFormat templateFormat,
global::System.Collections.Generic.Dictionary<string, string> secrets,
global::LangSmith.Highlight? highlighted = default,
global::LangSmith.Artifact? artifact = default,
global::LangSmith.PlaygroundPromptCanvasPayloadArtifactLength? artifactLength = default,
global::LangSmith.PlaygroundPromptCanvasPayloadReadingLevel? readingLevel = default,
string? customAction = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::LangSmith.PlaygroundPromptCanvasPayload
Expand All @@ -139,7 +143,9 @@ partial void ProcessPromptCanvasResponseContent(
Artifact = artifact,
ArtifactLength = artifactLength,
ReadingLevel = readingLevel,
CustomAction = customAction,
TemplateFormat = templateFormat,
Secrets = secrets,
};

return await PromptCanvasAsync(
Expand Down
10 changes: 10 additions & 0 deletions src/libs/LangSmith/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15681,6 +15681,7 @@ components:
required:
- messages
- template_format
- secrets
type: object
properties:
messages:
Expand Down Expand Up @@ -15722,12 +15723,21 @@ components:
- phd
type: string
nullable: true
custom_action:
title: Custom Action
type: string
nullable: true
template_format:
title: Template Format
enum:
- f-string
- mustache
type: string
secrets:
title: Secrets
type: object
additionalProperties:
type: string
PlaygroundRunOverDatasetRequestSchema:
title: PlaygroundRunOverDatasetRequestSchema
required:
Expand Down

0 comments on commit fa458f4

Please sign in to comment.