Created
December 11, 2023 14:37
-
-
Save wp-seopress/5756814961d4c2d2900eb5ca7a317654 to your computer and use it in GitHub Desktop.
Filter the arguments sent to OpenAI to generate alternative texts
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
add_filter('seopress_ai_openai_request_args_alt', 'sp_ai_openai_request_args_alt'); | |
function sp_ai_openai_request_args_alt($args) { | |
//do your stuff, this is just an example | |
//var_dump($body) | |
$args = [ | |
'body' => json_encode($body), | |
'timeout' => '30', | |
'redirection' => '5', | |
'httpversion' => '1.0', | |
'blocking' => true, | |
'headers' => [ | |
'Authorization' => 'Bearer ' . seopress_pro_get_service('Usage')->getLicenseKey(), | |
'Content-Type' => 'application/json' | |
], | |
]; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment