Skip to content
File

Blob: src/cloudflare/internal/test/ai/ai-api-test.py

python12 lines
1# Copyright (c) 2024 Cloudflare, Inc.
2# Licensed under the Apache 2.0 license found in the LICENSE file or at:
3# https://opensource.org/licenses/Apache-2.0
4 
5 
6async def test(context, env):
7 resp = await env.ai.run("testModel", {"prompt": "test"})
8 assert resp.response == "model response"
9 
10 # Test request id is present
11 assert env.ai.lastRequestId == "3a1983d7-1ddd-453a-ab75-c4358c91b582"