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 @@ -37,6 +37,9 @@ public partial interface IToolRegistryClient
/// <param name="toolDefinition">
/// Tool definition in OpenAI function-calling format
/// </param>
/// <param name="description">
/// Optional human-readable description of the tool
/// </param>
/// <param name="folderId">
/// Folder ID to place tool in
/// </param>
Expand All @@ -46,15 +49,20 @@ public partial interface IToolRegistryClient
/// <param name="externalIds">
/// Identifiers from other systems.
/// </param>
/// <param name="execution">
/// Optional sandbox-executable body for the tool. When set, PromptLayer auto-runs the body between LLM turns. See the Auto Tool Execution feature page.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::PromptLayer.CreateToolRegistryResponse> CreateToolRegistryAsync(
string name,
object toolDefinition,
string? description = default,
int? folderId = default,
string? commitMessage = default,
global::System.Collections.Generic.IList<global::PromptLayer.ExternalId>? externalIds = default,
global::PromptLayer.CreateToolRegistryRequestExecution? execution = default,
global::PromptLayer.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#nullable enable

namespace PromptLayer
{
public partial interface IToolRegistryClient
{
/// <summary>
/// Create Tool Version
/// </summary>
/// <param name="identifier">
/// Tool ID (numeric) or name
/// </param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PromptLayer.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PromptLayer.CreateToolVersionResponse> CreateToolVersionAsync(
string identifier,

global::PromptLayer.CreateToolVersionRequest request,
global::PromptLayer.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create Tool Version
/// </summary>
/// <param name="identifier">
/// Tool ID (numeric) or name
/// </param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PromptLayer.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PromptLayer.AutoSDKHttpResponse<global::PromptLayer.CreateToolVersionResponse>> CreateToolVersionAsResponseAsync(
string identifier,

global::PromptLayer.CreateToolVersionRequest request,
global::PromptLayer.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create Tool Version
/// </summary>
/// <param name="identifier">
/// Tool ID (numeric) or name
/// </param>
/// <param name="toolDefinition">
/// Tool definition in OpenAI function-calling format
/// </param>
/// <param name="execution">
/// Optional sandbox-executable body. When set, PromptLayer auto-runs the body between LLM turns whenever a prompt uses this version. See Auto Tool Execution.
/// </param>
/// <param name="commitMessage">
/// Commit message for the new version
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::PromptLayer.CreateToolVersionResponse> CreateToolVersionAsync(
string identifier,
object toolDefinition,
global::PromptLayer.CreateToolVersionRequestExecution? execution = default,
string? commitMessage = default,
global::PromptLayer.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#nullable enable

namespace PromptLayer
{
public partial interface IToolRegistryClient
{
/// <summary>
/// Test Execute Tool
/// </summary>
/// <param name="identifier">
/// Tool ID (numeric) or name
/// </param>
/// <param name="label">
/// Resolve version by label name (e.g. production). Falls back to latest if neither label nor version supplied.
/// </param>
/// <param name="version">
/// Resolve by specific version number
/// </param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PromptLayer.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PromptLayer.TestExecuteToolResponse> TestExecuteToolAsync(
string identifier,

global::PromptLayer.TestExecuteToolRequest request,
string? label = default,
string? version = default,
global::PromptLayer.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Test Execute Tool
/// </summary>
/// <param name="identifier">
/// Tool ID (numeric) or name
/// </param>
/// <param name="label">
/// Resolve version by label name (e.g. production). Falls back to latest if neither label nor version supplied.
/// </param>
/// <param name="version">
/// Resolve by specific version number
/// </param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PromptLayer.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PromptLayer.AutoSDKHttpResponse<global::PromptLayer.TestExecuteToolResponse>> TestExecuteToolAsResponseAsync(
string identifier,

global::PromptLayer.TestExecuteToolRequest request,
string? label = default,
string? version = default,
global::PromptLayer.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Test Execute Tool
/// </summary>
/// <param name="identifier">
/// Tool ID (numeric) or name
/// </param>
/// <param name="label">
/// Resolve version by label name (e.g. production). Falls back to latest if neither label nor version supplied.
/// </param>
/// <param name="version">
/// Resolve by specific version number
/// </param>
/// <param name="inputs">
/// Arguments passed to the tool body. Same shape the LLM would emit — keys match the tool's parameter names.
/// </param>
/// <param name="execution">
/// In-flight override of the stored execution config. Lets you test unsaved code.
/// </param>
/// <param name="toolDefinition">
/// In-flight override of the stored tool definition. Used to test against a different function name without saving.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::PromptLayer.TestExecuteToolResponse> TestExecuteToolAsync(
string identifier,
string? label = default,
string? version = default,
object? inputs = default,
global::PromptLayer.TestExecuteToolRequestExecution? execution = default,
object? toolDefinition = default,
global::PromptLayer.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace PromptLayer.JsonConverters
{
/// <inheritdoc />
public sealed class CreateToolRegistryRequestExecutionLanguageJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::PromptLayer.CreateToolRegistryRequestExecutionLanguage>
{
/// <inheritdoc />
public override global::PromptLayer.CreateToolRegistryRequestExecutionLanguage Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::PromptLayer.CreateToolRegistryRequestExecutionLanguageExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::PromptLayer.CreateToolRegistryRequestExecutionLanguage)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::PromptLayer.CreateToolRegistryRequestExecutionLanguage);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::PromptLayer.CreateToolRegistryRequestExecutionLanguage value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::PromptLayer.CreateToolRegistryRequestExecutionLanguageExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace PromptLayer.JsonConverters
{
/// <inheritdoc />
public sealed class CreateToolRegistryRequestExecutionLanguageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::PromptLayer.CreateToolRegistryRequestExecutionLanguage?>
{
/// <inheritdoc />
public override global::PromptLayer.CreateToolRegistryRequestExecutionLanguage? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::PromptLayer.CreateToolRegistryRequestExecutionLanguageExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::PromptLayer.CreateToolRegistryRequestExecutionLanguage)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::PromptLayer.CreateToolRegistryRequestExecutionLanguage?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::PromptLayer.CreateToolRegistryRequestExecutionLanguage? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::PromptLayer.CreateToolRegistryRequestExecutionLanguageExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace PromptLayer.JsonConverters
{
/// <inheritdoc />
public sealed class CreateToolRegistryRequestExecutionTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::PromptLayer.CreateToolRegistryRequestExecutionType>
{
/// <inheritdoc />
public override global::PromptLayer.CreateToolRegistryRequestExecutionType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::PromptLayer.CreateToolRegistryRequestExecutionTypeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::PromptLayer.CreateToolRegistryRequestExecutionType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::PromptLayer.CreateToolRegistryRequestExecutionType);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::PromptLayer.CreateToolRegistryRequestExecutionType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::PromptLayer.CreateToolRegistryRequestExecutionTypeExtensions.ToValueString(value));
}
}
}
Loading
Loading