Skip to content
Merged
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
31 changes: 31 additions & 0 deletions examples/basic/remote_pdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import asyncio

from agents import Agent, Runner

URL = "https://www.berkshirehathaway.com/letters/2024ltr.pdf"


async def main():
agent = Agent(
name="Assistant",
instructions="You are a helpful assistant.",
)

result = await Runner.run(
agent,
[
{
"role": "user",
"content": [{"type": "input_file", "file_url": URL}],
},
{
"role": "user",
"content": "Can you summarize the letter?",
},
],
)
print(result.final_output)


if __name__ == "__main__":
asyncio.run(main())