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 @@ -73,6 +73,17 @@ set of supported models and aliases.
{
Description = @"Optional webhook URL to call when the job completes or fails.
Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.
",
};

private static Option<global::System.Guid?> ConversationId { get; } = new(
name: @"--conversation-id")
{
Description = @"Conversation ID from a previous agent response. Pass it back on your
next call, with the same `project_id`, so the agent sees prior turns.
Omit it to start a new conversation.

Requires `project_id`.
",
};
private static Option<string?> Input { get; } = new(@"--input")
Expand Down Expand Up @@ -146,6 +157,7 @@ public static Command Create(string? commandName = null)
command.Options.Add(Prompt);
command.Options.Add(TeamAccess);
command.Options.Add(CallbackUrl);
command.Options.Add(ConversationId);
command.Options.Add(Input);
command.Options.Add(RequestJson);
command.Options.Add(RequestFile);
Expand Down Expand Up @@ -178,6 +190,7 @@ await CliRuntime.RunAsync(async () =>
var prompt = parseResult.GetRequiredValue(Prompt);
var teamAccess = CliRuntime.WasSpecified(parseResult, TeamAccess) ? parseResult.GetValue(TeamAccess) : (__requestBase is { } __TeamAccessBaseValue ? __TeamAccessBaseValue.TeamAccess : default);
var callbackUrl = CliRuntime.WasSpecified(parseResult, CallbackUrl) ? parseResult.GetValue(CallbackUrl) : (__requestBase is { } __CallbackUrlBaseValue ? __CallbackUrlBaseValue.CallbackUrl : default);
var conversationId = CliRuntime.WasSpecified(parseResult, ConversationId) ? parseResult.GetValue(ConversationId) : (__requestBase is { } __ConversationIdBaseValue ? __ConversationIdBaseValue.ConversationId : default);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


Expand All @@ -189,6 +202,7 @@ await CliRuntime.RunAsync(async () =>
prompt: prompt,
teamAccess: teamAccess,
callbackUrl: callbackUrl,
conversationId: conversationId,
cancellationToken: cancellationToken).ConfigureAwait(false);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static Command Create(string? commandName = null)
var command = new Command(commandName ?? @"get-job", @"Get job status
Retrieve the status of any job.

The response format varies based on job type and includes type-specific fields.
The response format varies based on job type and includes type-specific fields. A finished job has `job_state: stopped`. Read `result.status` for the outcome: `success`, or `error` when the job failed. Import jobs can also return `partial`. An individual file inside `result.media_status` uses `failed` when that file did not import.
");
command.Arguments.Add(JobId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ internal static partial class ApiEndpointsSearchCommandApiCommand
private static Option<string> Query { get; } = new(
name: @"--query")
{
Description = @"Search term. Matched against names and contents. Must be non-empty.
Description = @"Search term. Matched against names, contents, and visual matches
(on drives with the Enterprise plan). Must be non-empty.
",
Required = true,
};
Expand Down Expand Up @@ -64,8 +65,10 @@ are returned.
{
Description = @"How the query may match. Repeat this parameter to allow more than
one kind. `name` matches project, file, folder, and layout pack
names. `content` matches transcripts and composition text. If
omitted, names and contents both contribute.
names. `content` matches transcripts and composition text.
`visual` matches what appears in videos and images, and is only
available on drives with the Enterprise plan. `visual` cannot be combined
with another match kind. If omitted, only names and contents contribute.
",
};

Expand Down Expand Up @@ -116,7 +119,8 @@ public static Command Create(string? commandName = null)
Search the drive tied to the personal API token. Matches project names,
folder names, layout pack names, media file names, composition text,
and transcripts across projects, the drive media library, and Brand
Studio. Returns up to 100 results ranked by relevance.
Studio. On drives with the Enterprise plan, also allows searches for visual matches.
Returns up to 100 results.
");
command.Options.Add(Query);
command.Options.Add(UpdatedAfter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ partial void ProcessAgentEditJobResponseContent(
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Invalid input: - Malformed request body - Invalid project_id or composition_id format - Empty or invalid prompt
// Invalid input: - Malformed request body - Invalid project_id or composition_id format - Empty or invalid prompt - `conversation_id` belongs to a different project
if ((int)__response.StatusCode == 400)
{
string? __content_400 = null;
Expand Down Expand Up @@ -513,7 +513,7 @@ partial void ProcessAgentEditJobResponseContent(
h => h.Key,
h => h.Value));
}
// Not found: - Project doesn't exist - Composition doesn't exist in the specified project (when composition_id is provided)
// Not found: - Project doesn't exist - Composition doesn't exist in the specified project (when composition_id is provided) - `conversation_id` does not match an existing conversation
if ((int)__response.StatusCode == 404)
{
string? __content_404 = null;
Expand Down Expand Up @@ -744,6 +744,13 @@ partial void ProcessAgentEditJobResponseContent(
/// Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.<br/>
/// Example: https://example.com/webhooks/descript/job_callback
/// </param>
/// <param name="conversationId">
/// Conversation ID from a previous agent response. Pass it back on your<br/>
/// next call, with the same `project_id`, so the agent sees prior turns.<br/>
/// Omit it to start a new conversation.<br/>
/// Requires `project_id`.<br/>
/// Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
/// </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>
Expand All @@ -755,6 +762,7 @@ partial void ProcessAgentEditJobResponseContent(
string? model = default,
global::Descript.AgentEditJobRequestTeamAccess? teamAccess = default,
string? callbackUrl = default,
global::System.Guid? conversationId = default,
global::Descript.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand All @@ -767,6 +775,7 @@ partial void ProcessAgentEditJobResponseContent(
Prompt = prompt,
TeamAccess = teamAccess,
CallbackUrl = callbackUrl,
ConversationId = conversationId,
};

return await AgentEditJobAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ partial void ProcessGetJobResponseContent(
/// <summary>
/// Get job status<br/>
/// Retrieve the status of any job.<br/>
/// The response format varies based on job type and includes type-specific fields.
/// The response format varies based on job type and includes type-specific fields. A finished job has `job_state: stopped`. Read `result.status` for the outcome: `success`, or `error` when the job failed. Import jobs can also return `partial`. An individual file inside `result.media_status` uses `failed` when that file did not import.
/// </summary>
/// <param name="jobId"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand All @@ -66,7 +66,7 @@ partial void ProcessGetJobResponseContent(
/// <summary>
/// Get job status<br/>
/// Retrieve the status of any job.<br/>
/// The response format varies based on job type and includes type-specific fields.
/// The response format varies based on job type and includes type-specific fields. A finished job has `job_state: stopped`. Read `result.status` for the outcome: `success`, or `error` when the job failed. Import jobs can also return `partial`. An individual file inside `result.media_status` uses `failed` when that file did not import.
/// </summary>
/// <param name="jobId"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ partial void ProcessSearchResponseContent(
/// Search the drive tied to the personal API token. Matches project names,<br/>
/// folder names, layout pack names, media file names, composition text,<br/>
/// and transcripts across projects, the drive media library, and Brand<br/>
/// Studio. Returns up to 100 results ranked by relevance.
/// Studio. On drives with the Enterprise plan, also allows searches for visual matches.<br/>
/// Returns up to 100 results.
/// </summary>
/// <param name="query"></param>
/// <param name="updatedAfter"></param>
Expand Down Expand Up @@ -109,7 +110,8 @@ partial void ProcessSearchResponseContent(
/// Search the drive tied to the personal API token. Matches project names,<br/>
/// folder names, layout pack names, media file names, composition text,<br/>
/// and transcripts across projects, the drive media library, and Brand<br/>
/// Studio. Returns up to 100 results ranked by relevance.
/// Studio. On drives with the Enterprise plan, also allows searches for visual matches.<br/>
/// Returns up to 100 results.
/// </summary>
/// <param name="query"></param>
/// <param name="updatedAfter"></param>
Expand Down Expand Up @@ -487,6 +489,43 @@ partial void ProcessSearchResponseContent(
h => h.Key,
h => h.Value));
}
// Visual search (`match=visual`) is not enabled for the drive.
if ((int)__response.StatusCode == 403)
{
string? __content_403 = null;
global::System.Exception? __exception_403 = null;
global::Descript.Error403? __value_403 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_403 = global::Descript.Error403.FromJson(__content_403, JsonSerializerContext);
}
else
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_403 = global::Descript.Error403.FromJson(__content_403, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_403 = __ex;
}


throw global::Descript.ApiException<global::Descript.Error403>.Create(
statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
responseBody: __content_403,
responseObject: __value_403,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// The search endpoint is not enabled for the authenticated user.
if ((int)__response.StatusCode == 404)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ public partial interface IApiEndpointsClient
/// Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.<br/>
/// Example: https://example.com/webhooks/descript/job_callback
/// </param>
/// <param name="conversationId">
/// Conversation ID from a previous agent response. Pass it back on your<br/>
/// next call, with the same `project_id`, so the agent sees prior turns.<br/>
/// Omit it to start a new conversation.<br/>
/// Requires `project_id`.<br/>
/// Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
/// </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>
Expand All @@ -130,6 +137,7 @@ public partial interface IApiEndpointsClient
string? model = default,
global::Descript.AgentEditJobRequestTeamAccess? teamAccess = default,
string? callbackUrl = default,
global::System.Guid? conversationId = default,
global::Descript.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial interface IApiEndpointsClient
/// <summary>
/// Get job status<br/>
/// Retrieve the status of any job.<br/>
/// The response format varies based on job type and includes type-specific fields.
/// The response format varies based on job type and includes type-specific fields. A finished job has `job_state: stopped`. Read `result.status` for the outcome: `success`, or `error` when the job failed. Import jobs can also return `partial`. An individual file inside `result.media_status` uses `failed` when that file did not import.
/// </summary>
/// <param name="jobId"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand All @@ -20,7 +20,7 @@ public partial interface IApiEndpointsClient
/// <summary>
/// Get job status<br/>
/// Retrieve the status of any job.<br/>
/// The response format varies based on job type and includes type-specific fields.
/// The response format varies based on job type and includes type-specific fields. A finished job has `job_state: stopped`. Read `result.status` for the outcome: `success`, or `error` when the job failed. Import jobs can also return `partial`. An individual file inside `result.media_status` uses `failed` when that file did not import.
/// </summary>
/// <param name="jobId"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public partial interface IApiEndpointsClient
/// Search the drive tied to the personal API token. Matches project names,<br/>
/// folder names, layout pack names, media file names, composition text,<br/>
/// and transcripts across projects, the drive media library, and Brand<br/>
/// Studio. Returns up to 100 results ranked by relevance.
/// Studio. On drives with the Enterprise plan, also allows searches for visual matches.<br/>
/// Returns up to 100 results.
/// </summary>
/// <param name="query"></param>
/// <param name="updatedAfter"></param>
Expand Down Expand Up @@ -42,7 +43,8 @@ public partial interface IApiEndpointsClient
/// Search the drive tied to the personal API token. Matches project names,<br/>
/// folder names, layout pack names, media file names, composition text,<br/>
/// and transcripts across projects, the drive media library, and Brand<br/>
/// Studio. Returns up to 100 results ranked by relevance.
/// Studio. On drives with the Enterprise plan, also allows searches for visual matches.<br/>
/// Returns up to 100 results.
/// </summary>
/// <param name="query"></param>
/// <param name="updatedAfter"></param>
Expand Down
Loading
Loading