程式代碼解釋器可讓代理程式在沙箱執行環境中撰寫和執行 Python 程式代碼。 啟用程式代碼解釋器后,代理程式可以反覆執行程式碼,以解決更具挑戰性的程式碼、數學和數據分析問題。 當您的 Agent 撰寫無法執行的程式代碼時,可以修改並執行不同的程式碼,以逐一查看此程式代碼,直到程式碼執行成功為止。
這很重要
程式碼解譯器除了 Azure OpenAI 使用量的權杖費用之外,還有額外的費用。 如果您的代理程式在兩個不同的線程中同時呼叫程式代碼解釋器,則會建立兩個程式代碼解釋器會話。 每個會話預設一開始啟用持續 1 小時,閑置逾時為 30 分鐘。
支援的模型
模型 頁面 包含支援代理程式和程式代碼解釋器之區域/模型的最新資訊。
建議您搭配使用 Agents 與最新的模型,以利用新功能、較大的內容視窗,以及最新的定型數據。
使用支援
Azure AI Foundry 支援 | Python SDK | C# SDK | JavaScript SDK | REST API | 基本代理程序設定 | 標準代理程序設定 |
---|---|---|---|---|---|---|
✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
支援的檔案類型
檔案格式 | MIME 類型 |
---|---|
.c |
text/x-c |
.cpp |
text/x-c++ |
.csv |
application/csv |
.docx |
application/vnd.openxmlformats-officedocument.wordprocessingml.document |
.html |
text/html |
.java |
text/x-java |
.json |
application/json |
.md |
text/markdown |
.pdf |
application/pdf |
.php |
text/x-php |
.pptx |
application/vnd.openxmlformats-officedocument.presentationml.presentation |
.py |
text/x-python |
.py |
text/x-script.python |
.rb |
text/x-ruby |
.tex |
text/x-tex |
.txt |
text/plain |
.css |
text/css |
.jpeg |
image/jpeg |
.jpg |
image/jpeg |
.js |
text/javascript |
.gif |
image/gif |
.png |
image/png |
.tar |
application/x-tar |
.ts |
application/typescript |
.xlsx |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
.xml |
application/xml 或 text/xml |
.zip |
application/zip |