Skip to content

Methods for Session file and Agent code download "as_bytes" and "to_path". Add overwrite option when downloading to path.#47673

Open
dargilco wants to merge 15 commits into
feature/azure-ai-projects/2.3.0from
dargilco/agent-code-upload-download-to-file
Open

Methods for Session file and Agent code download "as_bytes" and "to_path". Add overwrite option when downloading to path.#47673
dargilco wants to merge 15 commits into
feature/azure-ai-projects/2.3.0from
dargilco/agent-code-upload-download-to-file

Conversation

@dargilco

@dargilco dargilco commented Jun 25, 2026

Copy link
Copy Markdown
Member

This pull request refactors and expands the agent code and session file download APIs for both sync and async clients. It standardizes method names for clarity, adds new methods to support direct-to-disk downloads with overwrite protection and SHA-256 verification, and updates internal request builders to match the new API surface.

API changes and method renaming:

  • Renamed download_code to download_code_as_bytes and download_session_file to download_session_file_as_bytes in both sync and async clients for clarity and consistency. [1] [2] [3] [4] [5]
  • Updated request builder function names to match the new method names (build_agents_download_code_as_bytes_request, build_agents_download_session_file_as_bytes_request). [1] [2]

New features:

  • Added download_code_to_path and download_session_file_to_path methods to both clients, allowing direct download of agent code or session files to a specified file path with overwrite protection. These methods raise errors if the path exists and is a directory, or if the file exists and overwrite=False. [1] [2] [3] [4]
  • download_code_to_path returns the SHA-256 hex digest of the downloaded file for integrity verification.

Documentation and metadata updates:

  • Updated docstrings to clearly describe the new parameters, error handling, and return values for the new methods. [1] [2]
  • Updated api.md, apiview-properties.json, and api.metadata.yml to reflect the new API surface and method mappings. [1] [2] [3]

Internal improvements:

  • Updated all internal references to the renamed methods and request builders to ensure consistency throughout the codebase. [1] [2] [3] [4] [5] [6]

Dependency changes:

  • Added hashlib import for SHA-256 checksum calculation in the new download-to-disk methods. [1] [2]

@dargilco dargilco changed the title Read/write from/to disk for Agent Code. Add overwrite to session file download Methods for Session file and Agent code download "as_bytes" and "to_path". Add overwrite option when downloading to path. Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant