diff options
author | Ben Sima <ben@bsima.me> | 2025-05-06 18:01:11 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2025-05-07 22:52:46 -0400 |
commit | b0d3330c67b6874a1eaf23978749b26d99fbdfab (patch) | |
tree | a21acfd5340431c0a07dcc12b515fe6f5f1fad8e /Biz | |
parent | 3127cefa0d01f18b5c503e797ee1cf87aa61964c (diff) |
Switch Python to unstable and add pydantic-ai
Pydantic-ai is an agent framework that seems simple and good: well-typed with
pydantic, tool usage is just an `@tool` decorator on a function, and so
on. While building these I realized there were some deps they needed that were
already in nixpkgs unstable, so I just switched to that instead of trying to
backport all the versions and stuff.
Diffstat (limited to 'Biz')
-rwxr-xr-x | Biz/Storybook.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Biz/Storybook.py b/Biz/Storybook.py index dbaf82a..57b84c6 100755 --- a/Biz/Storybook.py +++ b/Biz/Storybook.py @@ -309,7 +309,12 @@ def generate_image( size="1024x1024", quality="standard", ) - url = image_response.data[0].url + data = image_response.data + if data is None: + msg = "error getting data from OpenAI" + log.error(msg) + raise ludic.web.exceptions.InternalServerError(msg) + url = data[0].url if url is None: msg = "error getting image from OpenAI" log.error(msg) |