|
7 | 7 |
|
8 | 8 | from openai_agents.basic.workflows.remote_image_workflow import RemoteImageWorkflow |
9 | 9 |
|
| 10 | + |
10 | 11 | # TODO(@donald-pinckney): debug this test |
11 | | -# async def test_execute_workflow_default_question(client: Client): |
12 | | -# task_queue_name = str(uuid.uuid4()) |
13 | | - |
14 | | -# async with Worker( |
15 | | -# client, |
16 | | -# task_queue=task_queue_name, |
17 | | -# workflows=[RemoteImageWorkflow], |
18 | | -# activity_executor=ThreadPoolExecutor(5), |
19 | | -# # No external activities needed - uses remote URL directly |
20 | | -# ): |
21 | | -# # Using a reliable test image URL |
22 | | -# test_image_url = "https://httpbin.org/image/jpeg" |
23 | | - |
24 | | -# result = await client.execute_workflow( |
25 | | -# RemoteImageWorkflow.run, |
26 | | -# test_image_url, |
27 | | -# id=str(uuid.uuid4()), |
28 | | -# task_queue=task_queue_name, |
29 | | -# ) |
30 | | - |
31 | | -# # Verify the result is a string response |
32 | | -# assert isinstance(result, str) |
33 | | -# assert len(result) > 0 |
| 12 | +async def test_execute_workflow_default_question(client: Client): |
| 13 | + task_queue_name = str(uuid.uuid4()) |
| 14 | + |
| 15 | + async with Worker( |
| 16 | + client, |
| 17 | + task_queue=task_queue_name, |
| 18 | + workflows=[RemoteImageWorkflow], |
| 19 | + activity_executor=ThreadPoolExecutor(5), |
| 20 | + # No external activities needed - uses remote URL directly |
| 21 | + ): |
| 22 | + # Using a reliable test image URL |
| 23 | + test_image_url = "https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg" |
| 24 | + |
| 25 | + result = await client.execute_workflow( |
| 26 | + RemoteImageWorkflow.run, |
| 27 | + test_image_url, |
| 28 | + id=str(uuid.uuid4()), |
| 29 | + task_queue=task_queue_name, |
| 30 | + ) |
| 31 | + |
| 32 | + # Verify the result is a string response |
| 33 | + assert isinstance(result, str) |
| 34 | + assert len(result) > 0 |
34 | 35 |
|
35 | 36 |
|
36 | 37 | # TODO(@donald-pinckney): debug this test |
37 | | -# async def test_execute_workflow_custom_question(client: Client): |
38 | | -# task_queue_name = str(uuid.uuid4()) |
39 | | - |
40 | | -# async with Worker( |
41 | | -# client, |
42 | | -# task_queue=task_queue_name, |
43 | | -# workflows=[RemoteImageWorkflow], |
44 | | -# activity_executor=ThreadPoolExecutor(5), |
45 | | -# # No external activities needed - uses remote URL directly |
46 | | -# ): |
47 | | -# # Using a reliable test image URL |
48 | | -# test_image_url = "https://httpbin.org/image/png" |
49 | | -# custom_question = "What do you see in this image?" |
50 | | - |
51 | | -# result = await client.execute_workflow( |
52 | | -# RemoteImageWorkflow.run, |
53 | | -# args=[test_image_url, custom_question], |
54 | | -# id=str(uuid.uuid4()), |
55 | | -# task_queue=task_queue_name, |
56 | | -# ) |
57 | | - |
58 | | -# # Verify the result is a string response |
59 | | -# assert isinstance(result, str) |
60 | | -# assert len(result) > 0 |
| 38 | +async def test_execute_workflow_custom_question(client: Client): |
| 39 | + task_queue_name = str(uuid.uuid4()) |
| 40 | + |
| 41 | + async with Worker( |
| 42 | + client, |
| 43 | + task_queue=task_queue_name, |
| 44 | + workflows=[RemoteImageWorkflow], |
| 45 | + activity_executor=ThreadPoolExecutor(5), |
| 46 | + # No external activities needed - uses remote URL directly |
| 47 | + ): |
| 48 | + # Using a reliable test image URL |
| 49 | + test_image_url = "https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg" |
| 50 | + custom_question = "What do you see in this image?" |
| 51 | + |
| 52 | + result = await client.execute_workflow( |
| 53 | + RemoteImageWorkflow.run, |
| 54 | + args=[test_image_url, custom_question], |
| 55 | + id=str(uuid.uuid4()), |
| 56 | + task_queue=task_queue_name, |
| 57 | + ) |
| 58 | + |
| 59 | + # Verify the result is a string response |
| 60 | + assert isinstance(result, str) |
| 61 | + assert len(result) > 0 |
0 commit comments