Commit 196c926
Python: Remove FileContent and enhance BinaryContent for .NET alignment
Remove FileContent class and adapt its functionality to BinaryContent by default,
aligning with .NET Microsoft.Extensions.AI design patterns.
BinaryContent now handles file operations through:
- can_read property to check data availability (matches .NET CanRead)
- from_file() class method to create instances from file paths
- to_openai_file_dict() method for OpenAI Responses API integration
- Standard to_dict() preserves existing binary format
- Generated UUID-based filenames for OpenAI file format (like .NET GUID approach)
OpenAI integration updated to use BinaryContent with can_read check for file handling.
ImageContent behavior preserved with no breaking changes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 19557eb commit 196c926
5 files changed
Lines changed: 260 additions & 59 deletions
File tree
- .vscode
- python
- semantic_kernel
- agents/open_ai
- contents
- tests
- assets
- unit/agents/openai_responses
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
0 commit comments