-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate getLogs method from Ai binding
- Loading branch information
Showing
4 changed files
with
8 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
# Copyright (c) 2023 Cloudflare, Inc. | ||
# Copyright (c) 2024 Cloudflare, Inc. | ||
# Licensed under the Apache 2.0 license found in the LICENSE file or at: | ||
# https://opensource.org/licenses/Apache-2.0 | ||
|
||
async def test(context, env): | ||
resp = await env.ai.run('testModel', {"prompt": 'test'}) | ||
assert resp.response == "model response" | ||
|
||
# Test logs is empty | ||
assert len(env.ai.getLogs()) == 0 | ||
|
||
# Test request id is present | ||
assert env.ai.lastRequestId == '3a1983d7-1ddd-453a-ab75-c4358c91b582' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters