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 @@ -52465,6 +52465,11 @@
"type": "string",
"description": "The configured trigger name that produced the routine attempt."
},
"trigger_event_payload": {
"type": "object",
"unevaluatedProperties": {},
"description": "The event payload captured from the event that triggered the routine attempt, when available."
},
"attempt_source": {
"allOf": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35949,6 +35949,10 @@ components:
trigger_name:
type: string
description: The configured trigger name that produced the routine attempt.
trigger_event_payload:
type: object
unevaluatedProperties: {}
description: The event payload captured from the event that triggered the routine attempt, when available.
attempt_source:
allOf:
- $ref: '#/components/schemas/RoutineAttemptSource'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57229,6 +57229,11 @@
"type": "string",
"description": "The configured trigger name that produced the routine attempt."
},
"trigger_event_payload": {
"type": "object",
"unevaluatedProperties": {},
"description": "The event payload captured from the event that triggered the routine attempt, when available."
},
"attempt_source": {
"allOf": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39164,6 +39164,10 @@ components:
trigger_name:
type: string
description: The configured trigger name that produced the routine attempt.
trigger_event_payload:
type: object
unevaluatedProperties: {}
description: The event payload captured from the event that triggered the routine attempt, when available.
attempt_source:
allOf:
- $ref: '#/components/schemas/RoutineAttemptSource'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
using TypeSpec.Http;

namespace Azure.AI.Projects;

// ---------------------------------------------------------------------------
// Request parameter models
// ---------------------------------------------------------------------------

// Parameters for uploading a file to a session sandbox
alias UploadSessionFileParams = {
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The destination file path within the sandbox, relative to the session home directory. */
@query path: string;

/** The binary file content to upload. */
@header("Content-Type") contentType: "application/octet-stream";

@body content: bytes;
};

// Parameters for downloading a file from a session sandbox
alias DownloadSessionFileParams = {
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The file path to download from the sandbox, relative to the session home directory. */
@query path: string;
};

// Parameters for listing files in a session sandbox
alias ListSessionFilesParams = {
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The directory path to list, relative to the session home directory. Defaults to the home directory if not provided. */
@query path?: string;
};

// Parameters for deleting a file from a session sandbox
alias DeleteSessionFileParams = {
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The file or directory path to delete, relative to the session home directory. */
@query path: string;

/** Whether to recursively delete directory contents. The service defaults to `false` if a value is not specified by the caller. */
@query recursive?: boolean = false;
};

// ---------------------------------------------------------------------------
// Response models
// ---------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import "../common/servicepatterns.tsp";
import "./models.tsp";

using TypeSpec.Http;
using TypeSpec.OpenAPI;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

Expand All @@ -31,19 +29,7 @@ interface AgentSessionFiles {
@route("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content")
uploadSessionFile is FoundryDataPlaneOperation<
{
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The destination file path within the sandbox, relative to the session home directory. */
@query path: string;

/** The binary file content to upload. */
@header("Content-Type") contentType: "application/octet-stream";

@body content: bytes;
...UploadSessionFileParams;
},
ResourceCreatedResponse<SessionFileWriteResponse>
>;
Expand All @@ -57,14 +43,7 @@ interface AgentSessionFiles {
@route("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content")
downloadSessionFile is FoundryDataPlaneOperation<
{
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The file path to download from the sandbox, relative to the session home directory. */
@query path: string;
...DownloadSessionFileParams;
},
bytes
>;
Expand All @@ -79,15 +58,7 @@ interface AgentSessionFiles {
@route("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files")
listSessionFiles is FoundryDataPlaneOperation<
{
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The directory path to list, relative to the session home directory. Defaults to the home directory if not provided. */
@query path?: string;

...ListSessionFilesParams;
...CommonPageQueryParameters;
},
SessionDirectoryListResponse
Expand All @@ -102,17 +73,7 @@ interface AgentSessionFiles {
@route("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files")
deleteSessionFile is FoundryDataPlaneOperation<
{
/** The name of the agent. */
@path agent_name: string;

/** The session ID. */
@path agent_session_id: string;

/** The file or directory path to delete, relative to the session home directory. */
@query path: string;

/** Whether to recursively delete directory contents. The service defaults to `false` if a value is not specified by the caller. */
@query recursive?: boolean = false;
...DeleteSessionFileParams;
},
void
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ using Azure.AI.Projects;
@@clientName(AgentObject, "Agent", "javascript");
@@clientName(AgentVersionObject, "AgentVersion", "javascript");

// Python emitter creates enum A2_A_PREVIEW = "a2a_preview". Override it here to "A2A_PREVIEW".
@@clientName(_PreviewAgentToolType.a2a_preview, "A2A_PREVIEW", "python");

// Python emitter creates enum values ENUM_1_G = "1g", ENUM_4_G = "4g" etc. Override it here as below.
@@clientName(OpenAI.ContainerMemoryLimit.`1g`, exact("MEMORY_1GB"), "python");
@@clientName(OpenAI.ContainerMemoryLimit.`4g`, exact("MEMORY_4GB"), "python");
Expand All @@ -108,9 +105,44 @@ using Azure.AI.Projects;
@@clientName(_PreviewAgentToolType.a2a_preview, exact("A2A_PREVIEW"), "python");
@@clientName(ToolboxToolType.a2a_preview, exact("A2A_PREVIEW"), "python");
@@clientName(ProtocolConfiguration.a2a, exact("a2a"), "python");
@@clientName(AgentEndpointProtocol.a2a, exact("A2A"), "python");

@@clientName(OpenAI.ImageGenActionEnum, "ImageGenAction");

// DatasetItem model has a property `response_items?: OpenAI.OutputItem[]`. It is used
// to define Agent optimization request. If emitted as-is, it pulls in a lot of
// OpenAI responses classes. We want Foundry SDK to be free of those, therefore for the
// time being we define output item as a generic dictionary.
@@alternateType(OpenAI.OutputItem, Record<unknown>);

// Make this method internal, since it's patched with a new one that supports either binary or file-path input
@@access(AgentSessionFiles.uploadSessionFile, Access.internal, "python");
@@usage(SessionFileWriteResponse, Usage.output);
@@access(SessionFileWriteResponse, Access.public);

@@clientName(UploadSessionFileParams.path, "remote_path", "python");
@@clientName(DownloadSessionFileParams.path, "remote_path", "python");
@@clientName(ListSessionFilesParams.path, "remote_path", "python");
@@clientName(DeleteSessionFileParams.path, "remote_path", "python");

// Exclude these operations entirely from emitted SDK. These are convenience REST APIs that we don't think bring
// real value on SDK surface. We can do everything using createAgentVersionFromCode.
@@scope(Agents.createAgentFromCode, "!(python, javascript)");
@@scope(Agents.updateAgentFromCode, "!(python, javascript)");

@@clientName(Agents.downloadAgentCode, "download_code", "python");
@@clientName(Agents.createAgentVersionFromCode, "createVersionFromCode");

@@clientName(DownloadAgentCodeResponse, "DownloadAgentCodeResult", "python");
@@clientName(
SessionDirectoryListResponse,
"SessionDirectoryListResult",
"python"
);
@@clientName(SessionFileWriteResponse, "SessionFileWriteResult", "python");



// --------------------------------------------------------------------------------
// Datasets sub‐client
// --------------------------------------------------------------------------------
Expand Down Expand Up @@ -201,35 +233,6 @@ using Azure.AI.Projects;
@@clientName(AgentOptimizationJobs.cancel, "cancelOptimizationJob");
@@clientName(AgentOptimizationJobs.delete, "deleteOptimizationJob");

// DatasetItem model has a property `response_items?: OpenAI.OutputItem[]`. It is used
// to define Agent optimization request. If emitted as-is, it pulls in a lot of
// OpenAI responses classes. We want Foundry SDK to be free of those, therefore for the
// time being we define output item as a generic dictionary.
@@alternateType(OpenAI.OutputItem, Record<unknown>);

// Make this method internal, since it's patched with a new one that supports either binary or file-path input
@@access(AgentSessionFiles.uploadSessionFile, Access.internal, "python");
@@usage(SessionFileWriteResponse, Usage.output);
@@access(SessionFileWriteResponse, Access.public);

// Exclude these operations entirely from emitted SDK. These are convenience REST APIs that we don't think bring
// real value on SDK surface. We can do everything using createAgentVersionFromCode.
@@scope(Agents.createAgentFromCode, "!(python, javascript)");
@@scope(Agents.updateAgentFromCode, "!(python, javascript)");

@@clientName(Agents.downloadAgentCode, "download_code", "python");
@@clientName(Agents.createAgentVersionFromCode, "createVersionFromCode");

@@clientName(DownloadAgentCodeResponse, "DownloadAgentCodeResult", "python");
@@clientName(
SessionDirectoryListResponse,
"SessionDirectoryListResult",
"python"
);
@@clientName(SessionFileWriteResponse, "SessionFileWriteResult", "python");

@@clientName(AgentEndpointProtocol.a2a, exact("A2A"), "python");

// All emitted Python classes already have "items" in the base class, so we need to pick another name
@@clientName(OptimizationInlineDatasetInput.items, "dataset_items", "python");

Expand Down
Loading