-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for extra request parameters (headers, body, query)
Add support for specifying extra_headers, extra_body, and extra_query arguments in OpenAI function calls: - ai.openai_list_models - ai.openai_embed - ai.openai_chat_complete - ai.openai_moderate These parameters are passed through to the underlying OpenAI library methods that support them, enabling more flexible request customization. This change allows users to: - Add custom HTTP headers via extra_headers - Include additional body parameters via extra_body - Specify extra query parameters via extra_query All parameters are passed unchanged to the corresponding OpenAI library methods.
- Loading branch information
1 parent
4aad292
commit f74defd
Showing
8 changed files
with
241 additions
and
105 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
27 changes: 27 additions & 0 deletions
27
projects/extension/sql/incremental/014-extra-openai-args.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,27 @@ | ||
drop function if exists ai.openai_list_models(text, text, text); | ||
drop function if exists ai.openai_embed(text, text, text, text, text, int, text); | ||
drop function if exists ai.openai_embed(text, text [], text, text, text, int, text); | ||
drop function if exists ai.openai_embed(text, int [], text, text, text, int, text); | ||
drop function if exists ai.openai_chat_complete( | ||
text, | ||
jsonb, | ||
text, | ||
text, | ||
text, | ||
float8, | ||
jsonb, | ||
boolean, | ||
int, | ||
int, | ||
int, | ||
float8, | ||
jsonb, | ||
int, | ||
text, | ||
float8, | ||
float8, | ||
jsonb, | ||
text, | ||
text | ||
); | ||
drop function if exists ai.openai_moderate(text, text, text, text, text); |
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
Oops, something went wrong.