- Implemented StreamInterface, UploadedFileInterface, and UriInterface as per PSR standards. - Added getallheaders function to retrieve HTTP headers in a compatible manner. - Included LICENSE files for ralouphie/getallheaders and symfony/deprecation-contracts. - Introduced function for triggering deprecation notices in Symfony.
41 lines
849 B
PHP
41 lines
849 B
PHP
<?php
|
|
/**
|
|
* API functions.
|
|
*
|
|
* @since 0.1.0
|
|
* @package ai-services
|
|
*/
|
|
|
|
use ATFPP\AI_Translate\Services\Services_API;
|
|
use ATFPP\AI_Translate\Services\Services_API_Instance;
|
|
|
|
/**
|
|
* Returns the AI services API instance, which is used to interact with the AI services.
|
|
*
|
|
* Examples:
|
|
*
|
|
* ```
|
|
* atfpp_ai_services()->get_available_service()
|
|
* ->get_model( array( 'feature' => 'my-test-feature' ) )
|
|
* ->generate_text( 'How can you help me?' )
|
|
* ```
|
|
*
|
|
* ```
|
|
* atfpp_ai_services()->get_available_service( 'google' )
|
|
* ->get_model(
|
|
* array(
|
|
* 'feature' => 'my-test-feature',
|
|
* 'model' => 'gemini-1.5-pro',
|
|
* )
|
|
* )
|
|
* ->generate_text( 'How can you help me?' )
|
|
* ```
|
|
*
|
|
* @since 0.1.0
|
|
*
|
|
* @return Services_API The API instance.
|
|
*/
|
|
function atfpp_ai_services() {
|
|
return Services_API_Instance::get();
|
|
}
|