(suggest)
REST APIs for managing LLM OAS suggestions
- suggest - Generate suggestions for improving an OpenAPI document.
- suggestItems - Generate generic suggestions for a list of items.
- suggestOpenAPI - (DEPRECATED) Generate suggestions for improving an OpenAPI document.
- suggestOpenAPIRegistry - Generate suggestions for improving an OpenAPI document stored in the registry.
Get suggestions from an LLM model for improving an OpenAPI document.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\SuggestRequest(
suggestRequestBody: new Shared\SuggestRequestBody(
diagnostics: [
new Shared\Diagnostic(
message: '<value>',
path: [
'/rescue',
],
type: '<value>',
),
],
oasSummary: new Shared\OASSummary(
info: new Shared\OASInfo(
description: 'kielbasa psst stitcher cannon devoted blindly apropos low',
license: new Shared\License(),
summary: '<value>',
title: '<value>',
version: '<value>',
),
operations: [
new Shared\OASOperation(
description: 'via apparatus gray whether opposite what',
method: '<value>',
operationId: '<id>',
path: '/sys',
tags: [
'<value>',
],
),
],
),
suggestionType: Shared\SuggestRequestBodySuggestionType::MethodNames,
),
xSessionId: '<id>',
);
$response = $sdk->suggest->suggest(
request: $request
);
if ($response->schema !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SuggestRequest | ✔️ | The request object to use for the request. |
Error Type | Status Code | Content Type |
---|---|---|
Errorors\SDKException | 4XX, 5XX | */* |
Generate generic suggestions for a list of items.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Shared\SuggestItemsRequestBody(
items: [
'<value>',
],
prompt: '<value>',
);
$response = $sdk->suggest->suggestItems(
request: $request
);
if ($response->strings !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Shared\SuggestItemsRequestBody | ✔️ | The request object to use for the request. |
?Operations\SuggestItemsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\SDKException | 4XX, 5XX | */* |
Get suggestions from an LLM model for improving an OpenAPI document.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\SuggestOpenAPIRequest(
requestBody: new Operations\SuggestOpenAPIRequestBody(
schema: new Operations\Schema(
content: '0x0beEcB7cF6',
fileName: 'example.file',
),
),
xSessionId: '<id>',
);
$response = $sdk->suggest->suggestOpenAPI(
request: $request
);
if ($response->schema !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SuggestOpenAPIRequest | ✔️ | The request object to use for the request. |
?Operations\SuggestOpenAPIResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\SDKException | 4XX, 5XX | */* |
Get suggestions from an LLM model for improving an OpenAPI document stored in the registry.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\SuggestOpenAPIRegistryRequest(
namespaceName: '<value>',
revisionReference: '<value>',
xSessionId: '<id>',
);
$response = $sdk->suggest->suggestOpenAPIRegistry(
request: $request
);
if ($response->schema !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SuggestOpenAPIRegistryRequest | ✔️ | The request object to use for the request. |
?Operations\SuggestOpenAPIRegistryResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\SDKException | 4XX, 5XX | */* |