Skip to content

Commit 528e754

Browse files
author
kevin
committed
release(0.2.60): Release php SDK
1 parent c00a331 commit 528e754

18 files changed

+1374
-37
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ Class | Method | HTTP request | Description
307307
- [WebSearchResponse](docs/Model/WebSearchResponse.md)
308308
- [WebSearchResult](docs/Model/WebSearchResult.md)
309309
- [WebSearchResult1](docs/Model/WebSearchResult1.md)
310+
- [WebSource](docs/Model/WebSource.md)
311+
- [WebSourceParams](docs/Model/WebSourceParams.md)
310312
- [WebhookAction](docs/Model/WebhookAction.md)
311313
- [WebhookParams](docs/Model/WebhookParams.md)
312314

docs/Api/WebsearchApi.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All URIs are relative to https://api.asknews.app, except if the operation define
1010
## `liveWebSearch()`
1111

1212
```php
13-
liveWebSearch($queries, $lookback, $domains): \AskNews\Model\WebSearchResponse
13+
liveWebSearch($queries, $lookback, $domains, $strict, $offset): \AskNews\Model\WebSearchResponse
1414
```
1515

1616
Run a live websearch.
@@ -40,11 +40,13 @@ $apiInstance = new AskNews\Api\WebsearchApi(
4040
$config
4141
);
4242
$queries = array('queries_example'); // string[] | A list of queries to be live searched, analyzed, distilled, and structured.
43-
$lookback = 56; // int | Number of days back to allow the websearch to look. Defaults to All time
43+
$lookback = 56; // int | Number of hours back to allow the websearch to look. Defaults to All time
4444
$domains = array('domains_example'); // string[] | A list of domains to search.
45+
$strict = false; // bool | If true, the websearch will only return results that have a known publication date and are within the lookback period.
46+
$offset = 56; // int | The number of results to offset for followup queries.
4547

4648
try {
47-
$result = $apiInstance->liveWebSearch($queries, $lookback, $domains);
49+
$result = $apiInstance->liveWebSearch($queries, $lookback, $domains, $strict, $offset);
4850
print_r($result);
4951
} catch (Exception $e) {
5052
echo 'Exception when calling WebsearchApi->liveWebSearch: ', $e->getMessage(), PHP_EOL;
@@ -56,8 +58,10 @@ try {
5658
| Name | Type | Description | Notes |
5759
| ------------- | ------------- | ------------- | ------------- |
5860
| **queries** | [**string[]**](../Model/string.md)| A list of queries to be live searched, analyzed, distilled, and structured. | |
59-
| **lookback** | **int**| Number of days back to allow the websearch to look. Defaults to All time | [optional] |
61+
| **lookback** | **int**| Number of hours back to allow the websearch to look. Defaults to All time | [optional] |
6062
| **domains** | [**string[]**](../Model/string.md)| A list of domains to search. | [optional] |
63+
| **strict** | **bool**| If true, the websearch will only return results that have a known publication date and are within the lookback period. | [optional] [default to false] |
64+
| **offset** | **int**| The number of results to offset for followup queries. | [optional] |
6165

6266
### Return type
6367

docs/Model/SourcesInner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**identifier** | **string** | |
8-
**params** | [**\AskNews\Model\BlueskySourceParams**](BlueskySourceParams.md) | |
8+
**params** | [**\AskNews\Model\WebSourceParams**](WebSourceParams.md) | |
99

1010
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/WebSearchResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**as_string** | **string** | |
88
**as_dicts** | [**\AskNews\Model\WebSearchResult[]**](WebSearchResult.md) | |
9+
**offset** | **int** | | [optional]
910

1011
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/WebSource.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# # WebSource
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**identifier** | **string** | |
8+
**params** | [**\AskNews\Model\WebSourceParams**](WebSourceParams.md) | |
9+
10+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/WebSourceParams.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# # WebSourceParams
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**queries** | **string[]** | The queries to use for the web search. This is a list of strings. |
8+
**domains** | **string[]** | | [optional]
9+
**strict** | **bool** | If true, the web search will only return results that have a known publication date and are within the lookback period. | [optional] [default to true]
10+
**lookback** | **int** | The number of hours back to accept for the web search. If not provided, no lookback will be applied. | [optional] [default to 24]
11+
12+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

lib/Api/WebsearchApi.php

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,19 @@ public function getConfig()
114114
* Run a live websearch.
115115
*
116116
* @param string[] $queries A list of queries to be live searched, analyzed, distilled, and structured. (required)
117-
* @param int $lookback Number of days back to allow the websearch to look. Defaults to All time (optional)
117+
* @param int $lookback Number of hours back to allow the websearch to look. Defaults to All time (optional)
118118
* @param string[] $domains A list of domains to search. (optional)
119+
* @param bool $strict If true, the websearch will only return results that have a known publication date and are within the lookback period. (optional, default to false)
120+
* @param int $offset The number of results to offset for followup queries. (optional)
119121
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveWebSearch'] to see the possible values for this operation
120122
*
121123
* @throws \AskNews\ApiException on non-2xx response or if the response body is not in the expected format
122124
* @throws \InvalidArgumentException
123125
* @return \AskNews\Model\WebSearchResponse|\AskNews\Model\HTTPValidationError
124126
*/
125-
public function liveWebSearch($queries, $lookback = null, $domains = null, string $contentType = self::contentTypes['liveWebSearch'][0])
127+
public function liveWebSearch($queries, $lookback = null, $domains = null, $strict = false, $offset = null, string $contentType = self::contentTypes['liveWebSearch'][0])
126128
{
127-
list($response) = $this->liveWebSearchWithHttpInfo($queries, $lookback, $domains, $contentType);
129+
list($response) = $this->liveWebSearchWithHttpInfo($queries, $lookback, $domains, $strict, $offset, $contentType);
128130
return $response;
129131
}
130132

@@ -134,17 +136,19 @@ public function liveWebSearch($queries, $lookback = null, $domains = null, strin
134136
* Run a live websearch.
135137
*
136138
* @param string[] $queries A list of queries to be live searched, analyzed, distilled, and structured. (required)
137-
* @param int $lookback Number of days back to allow the websearch to look. Defaults to All time (optional)
139+
* @param int $lookback Number of hours back to allow the websearch to look. Defaults to All time (optional)
138140
* @param string[] $domains A list of domains to search. (optional)
141+
* @param bool $strict If true, the websearch will only return results that have a known publication date and are within the lookback period. (optional, default to false)
142+
* @param int $offset The number of results to offset for followup queries. (optional)
139143
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveWebSearch'] to see the possible values for this operation
140144
*
141145
* @throws \AskNews\ApiException on non-2xx response or if the response body is not in the expected format
142146
* @throws \InvalidArgumentException
143147
* @return array of \AskNews\Model\WebSearchResponse|\AskNews\Model\HTTPValidationError, HTTP status code, HTTP response headers (array of strings)
144148
*/
145-
public function liveWebSearchWithHttpInfo($queries, $lookback = null, $domains = null, string $contentType = self::contentTypes['liveWebSearch'][0])
149+
public function liveWebSearchWithHttpInfo($queries, $lookback = null, $domains = null, $strict = false, $offset = null, string $contentType = self::contentTypes['liveWebSearch'][0])
146150
{
147-
$request = $this->liveWebSearchRequest($queries, $lookback, $domains, $contentType);
151+
$request = $this->liveWebSearchRequest($queries, $lookback, $domains, $strict, $offset, $contentType);
148152

149153
try {
150154
$options = $this->createHttpClientOption();
@@ -295,16 +299,18 @@ public function liveWebSearchWithHttpInfo($queries, $lookback = null, $domains =
295299
* Run a live websearch.
296300
*
297301
* @param string[] $queries A list of queries to be live searched, analyzed, distilled, and structured. (required)
298-
* @param int $lookback Number of days back to allow the websearch to look. Defaults to All time (optional)
302+
* @param int $lookback Number of hours back to allow the websearch to look. Defaults to All time (optional)
299303
* @param string[] $domains A list of domains to search. (optional)
304+
* @param bool $strict If true, the websearch will only return results that have a known publication date and are within the lookback period. (optional, default to false)
305+
* @param int $offset The number of results to offset for followup queries. (optional)
300306
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveWebSearch'] to see the possible values for this operation
301307
*
302308
* @throws \InvalidArgumentException
303309
* @return \GuzzleHttp\Promise\PromiseInterface
304310
*/
305-
public function liveWebSearchAsync($queries, $lookback = null, $domains = null, string $contentType = self::contentTypes['liveWebSearch'][0])
311+
public function liveWebSearchAsync($queries, $lookback = null, $domains = null, $strict = false, $offset = null, string $contentType = self::contentTypes['liveWebSearch'][0])
306312
{
307-
return $this->liveWebSearchAsyncWithHttpInfo($queries, $lookback, $domains, $contentType)
313+
return $this->liveWebSearchAsyncWithHttpInfo($queries, $lookback, $domains, $strict, $offset, $contentType)
308314
->then(
309315
function ($response) {
310316
return $response[0];
@@ -318,17 +324,19 @@ function ($response) {
318324
* Run a live websearch.
319325
*
320326
* @param string[] $queries A list of queries to be live searched, analyzed, distilled, and structured. (required)
321-
* @param int $lookback Number of days back to allow the websearch to look. Defaults to All time (optional)
327+
* @param int $lookback Number of hours back to allow the websearch to look. Defaults to All time (optional)
322328
* @param string[] $domains A list of domains to search. (optional)
329+
* @param bool $strict If true, the websearch will only return results that have a known publication date and are within the lookback period. (optional, default to false)
330+
* @param int $offset The number of results to offset for followup queries. (optional)
323331
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveWebSearch'] to see the possible values for this operation
324332
*
325333
* @throws \InvalidArgumentException
326334
* @return \GuzzleHttp\Promise\PromiseInterface
327335
*/
328-
public function liveWebSearchAsyncWithHttpInfo($queries, $lookback = null, $domains = null, string $contentType = self::contentTypes['liveWebSearch'][0])
336+
public function liveWebSearchAsyncWithHttpInfo($queries, $lookback = null, $domains = null, $strict = false, $offset = null, string $contentType = self::contentTypes['liveWebSearch'][0])
329337
{
330338
$returnType = '\AskNews\Model\WebSearchResponse';
331-
$request = $this->liveWebSearchRequest($queries, $lookback, $domains, $contentType);
339+
$request = $this->liveWebSearchRequest($queries, $lookback, $domains, $strict, $offset, $contentType);
332340

333341
return $this->client
334342
->sendAsync($request, $this->createHttpClientOption())
@@ -370,14 +378,16 @@ function ($exception) {
370378
* Create request for operation 'liveWebSearch'
371379
*
372380
* @param string[] $queries A list of queries to be live searched, analyzed, distilled, and structured. (required)
373-
* @param int $lookback Number of days back to allow the websearch to look. Defaults to All time (optional)
381+
* @param int $lookback Number of hours back to allow the websearch to look. Defaults to All time (optional)
374382
* @param string[] $domains A list of domains to search. (optional)
383+
* @param bool $strict If true, the websearch will only return results that have a known publication date and are within the lookback period. (optional, default to false)
384+
* @param int $offset The number of results to offset for followup queries. (optional)
375385
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveWebSearch'] to see the possible values for this operation
376386
*
377387
* @throws \InvalidArgumentException
378388
* @return \GuzzleHttp\Psr7\Request
379389
*/
380-
public function liveWebSearchRequest($queries, $lookback = null, $domains = null, string $contentType = self::contentTypes['liveWebSearch'][0])
390+
public function liveWebSearchRequest($queries, $lookback = null, $domains = null, $strict = false, $offset = null, string $contentType = self::contentTypes['liveWebSearch'][0])
381391
{
382392

383393
// verify the required parameter 'queries' is set
@@ -390,6 +400,8 @@ public function liveWebSearchRequest($queries, $lookback = null, $domains = null
390400

391401

392402

403+
404+
393405
$resourcePath = '/v1/chat/websearch';
394406
$formParams = [];
395407
$queryParams = [];
@@ -424,6 +436,24 @@ public function liveWebSearchRequest($queries, $lookback = null, $domains = null
424436
true, // explode
425437
false // required
426438
) ?? []);
439+
// query params
440+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
441+
$strict,
442+
'strict', // param base name
443+
'boolean', // openApiType
444+
'form', // style
445+
true, // explode
446+
false // required
447+
) ?? []);
448+
// query params
449+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
450+
$offset,
451+
'offset', // param base name
452+
'integer', // openApiType
453+
'form', // style
454+
true, // explode
455+
false // required
456+
) ?? []);
427457

428458

429459

lib/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Configuration
8585
*
8686
* @var string
8787
*/
88-
protected $userAgent = 'asknews-sdk-php-0.2.59';
88+
protected $userAgent = 'asknews-sdk-php-0.2.60';
8989

9090
/**
9191
* Debug switch (default set to false)

lib/Model/CreateAlertRequest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ public function getModelName()
296296

297297
public const MODEL_META_LLAMA_META_LLAMA_3_1_8_B_INSTRUCT = 'meta-llama/Meta-Llama-3.1-8B-Instruct';
298298
public const MODEL_GPT_4O_MINI = 'gpt-4o-mini';
299+
public const MODEL_GPT_5_MINI = 'gpt-5-mini';
300+
public const MODEL_GPT_5_NANO = 'gpt-5-nano';
299301
public const MODEL_GPT_4O = 'gpt-4o';
300302
public const MODEL_O3_MINI = 'o3-mini';
301303
public const MODEL_META_LLAMA_META_LLAMA_3_3_70_B_INSTRUCT = 'meta-llama/Meta-Llama-3.3-70B-Instruct';
@@ -313,6 +315,8 @@ public function getModelAllowableValues()
313315
return [
314316
self::MODEL_META_LLAMA_META_LLAMA_3_1_8_B_INSTRUCT,
315317
self::MODEL_GPT_4O_MINI,
318+
self::MODEL_GPT_5_MINI,
319+
self::MODEL_GPT_5_NANO,
316320
self::MODEL_GPT_4O,
317321
self::MODEL_O3_MINI,
318322
self::MODEL_META_LLAMA_META_LLAMA_3_3_70_B_INSTRUCT,

lib/Model/ReportRequest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,15 @@ public function getModelName()
240240
return self::$openAPIModelName;
241241
}
242242

243+
public const MODEL_GPT_5 = 'gpt-5';
243244
public const MODEL_GPT_4O = 'gpt-4o';
244-
public const MODEL_GPT_4O_MINI = 'gpt-4o-mini';
245+
public const MODEL_GPT_4_1_2025_04_14 = 'gpt-4.1-2025-04-14';
246+
public const MODEL_GPT_4_1_MINI_2025_04_14GPT_4O_MINI = 'gpt-4.1-mini-2025-04-14gpt-4o-mini';
245247
public const MODEL_O3_MINI = 'o3-mini';
246248
public const MODEL_CLAUDE_3_5_SONNET_LATEST = 'claude-3-5-sonnet-latest';
249+
public const MODEL_CLAUDE_SONNET_4_20250514 = 'claude-sonnet-4-20250514';
247250
public const MODEL_META_LLAMA_META_LLAMA_3_1_405_B_INSTRUCT = 'meta-llama/Meta-Llama-3.1-405B-Instruct';
248251
public const MODEL_META_LLAMA_META_LLAMA_3_3_70_B_INSTRUCT = 'meta-llama/Meta-Llama-3.3-70B-Instruct';
249-
public const MODEL_GPT_4_1_2025_04_14 = 'gpt-4.1-2025-04-14';
250-
public const MODEL_GPT_4_1_MINI_2025_04_14 = 'gpt-4.1-mini-2025-04-14';
251252

252253
/**
253254
* Gets allowable values of the enum
@@ -257,14 +258,15 @@ public function getModelName()
257258
public function getModelAllowableValues()
258259
{
259260
return [
261+
self::MODEL_GPT_5,
260262
self::MODEL_GPT_4O,
261-
self::MODEL_GPT_4O_MINI,
263+
self::MODEL_GPT_4_1_2025_04_14,
264+
self::MODEL_GPT_4_1_MINI_2025_04_14GPT_4O_MINI,
262265
self::MODEL_O3_MINI,
263266
self::MODEL_CLAUDE_3_5_SONNET_LATEST,
267+
self::MODEL_CLAUDE_SONNET_4_20250514,
264268
self::MODEL_META_LLAMA_META_LLAMA_3_1_405_B_INSTRUCT,
265269
self::MODEL_META_LLAMA_META_LLAMA_3_3_70_B_INSTRUCT,
266-
self::MODEL_GPT_4_1_2025_04_14,
267-
self::MODEL_GPT_4_1_MINI_2025_04_14,
268270
];
269271
}
270272

0 commit comments

Comments
 (0)