Skip to content

Commit

Permalink
Small fixes to tests and logging
Browse files Browse the repository at this point in the history
The tester user needs the pg_read_server_files role.
Remove some debug logging from ollama_chat_complete.
  • Loading branch information
jgpruitt committed Jun 20, 2024
1 parent 88e7f71 commit 0fb5a6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ai--0.1.0--0.2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ if not isinstance(_messages_1, list):
for message in _messages_1:
if 'images' in message:
decoded = [base64.b64decode(image) for image in message["images"]]
plpy.warning(f"number of images: {len(decoded)}")
plpy.warning(f"the type of the image is: {type(decoded[0])}")
message["images"] = decoded

from ollama import Client
Expand Down
7 changes: 7 additions & 0 deletions test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ select not has_function_privilege('tester', 'pg_read_binary_file(text)', 'execut
grant execute on function pg_read_binary_file(text) to tester;
\endif

select not pg_has_role('tester', 'pg_read_server_files', 'member') as grant_tester
\gset

\if :grant_tester
grant pg_read_server_files to tester;
\endif

set role tester;

-------------------------------------------------------------------------------
Expand Down

0 comments on commit 0fb5a6c

Please sign in to comment.