-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: change type of keep_alive to text (#251)
The `keep_alive` parameter to the `ai.ollama_embed`, `ai.ollama_generate`, and `ai.ollama_chat_complete` functions now takes a `text` value instead of a `float8` value. This makes for a more flexible API, as `keep_alive` can now be specified using human-readable duration values like `'10m'`, in addition to numeric (text) values like `'120'`. This is a breaking change. The impact of this change is twofold: Users who used `keep_alive => <some floating point value>` in the argument to one of `ai.ollama_embed`, `ai.ollama_generate`, or `ai.ollama_chat_complete` must cast that value to `text`, i.e. `keep_alive => <some floating point value>::text`. Users who have used one of the `ai.ollama_embed`, `ai.ollama_generate`, or `ai.ollama_chat_complete` functions in a SQL function using the `sql_body` form (see [CREATE FUNCTION]), or in a view will be forced to drop those functions and views, upgrade the pgai extension, and then re-create the functions and views. [CREATE FUNCTION]: https://www.postgresql.org/docs/current/sql-createfunction.html
- Loading branch information
1 parent
1ab5c16
commit 0c74741
Showing
5 changed files
with
24 additions
and
21 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
3 changes: 3 additions & 0 deletions
3
projects/extension/sql/incremental/008-drop-ollama-functions-with-keep-alive.sql
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
drop function if exists ai.ollama_embed(text, text, text, float8, jsonb); | ||
drop function if exists ai.ollama_generate(text, text, text, bytea[], float8, jsonb, text, text, int[]); | ||
drop function if exists ai.ollama_chat_complete(text, jsonb, text, float8, jsonb); |
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