|
6 | 6 | - [getWeatherByDate](#getweatherbydate) |
7 | 7 | - [getWeatherSummaryByDate](#getweathersummarybydate) |
8 | 8 | - [getWeatherOverviewByDate](#getweatheroverviewbydate) |
| 9 | + - [AI Assistant](#ai-assistant) |
| 10 | + - [startSession](#startsession) |
| 11 | + - [resumeSession](#resumesession) |
9 | 12 | - [Weather](#weather) |
10 | 13 | - [getCurrent](#getcurrent) |
11 | 14 | - [getForecast](#getforecast) |
@@ -84,6 +87,36 @@ Returns a [`WeatherOverview`](05-entities.md#weatheroverview) object: |
84 | 87 | $weatherOverview = $api->oneCall()->getWeatherOverviewByDate(50, 50, new \DateTime('today')); |
85 | 88 | ``` |
86 | 89 |
|
| 90 | +### AI Assistant |
| 91 | + |
| 92 | +#### `startSession` |
| 93 | + |
| 94 | +```php |
| 95 | +startSession(string $prompt): Answer |
| 96 | +``` |
| 97 | + |
| 98 | +Start a new session (create a new conversation) with the Weather AI Assistant. |
| 99 | + |
| 100 | +Returns a [`Answer`](05-entities.md#answer) object: |
| 101 | + |
| 102 | +```php |
| 103 | +$answer = $api->assistant()->startSession('How is the weather today in Lisbon?'); |
| 104 | +``` |
| 105 | + |
| 106 | +#### `resumeSession` |
| 107 | + |
| 108 | +```php |
| 109 | +resumeSession(string $sessionId, string $prompt): Answer |
| 110 | +``` |
| 111 | + |
| 112 | +Resume a session (continue a conversation) with the Weather AI Assistant. |
| 113 | + |
| 114 | +Returns a [`Answer`](05-entities.md#answer) object: |
| 115 | + |
| 116 | +```php |
| 117 | +$answer = $api->assistant()->resumeSession('session-id', 'Do I need an umbrella?'); |
| 118 | +``` |
| 119 | + |
87 | 120 | ### Weather |
88 | 121 |
|
89 | 122 | #### `getCurrent` |
@@ -192,7 +225,7 @@ $locations = $api->geocoding()->getByLocationName('lisbon'); |
192 | 225 | getByCoordinate(float $latitude, float $longitude, int $numResults = 5): array |
193 | 226 | ``` |
194 | 227 |
|
195 | | -Get name of the location (city name or area name) by using geographical coordinates (latitude, longitude). |
| 228 | +Get the name of the location (city name or area name) by using geographical coordinates (latitude, longitude). |
196 | 229 |
|
197 | 230 | Returns an array of [`Location`](05-entities.md#location) objects. |
198 | 231 |
|
@@ -261,7 +294,7 @@ withCacheTtl(?int $ttl): self |
261 | 294 | Makes a request and saves into cache for the provided duration in seconds. |
262 | 295 |
|
263 | 296 | Semantics of values: |
264 | | -- `0`, the response will not be cached (if the servers specifies no `max-age`). |
| 297 | +- `0`, the response will not be cached (if the server specifies no `max-age`). |
265 | 298 | - `null`, the response will be cached for as long as it can (forever). |
266 | 299 |
|
267 | 300 | > [!NOTE] |
|
0 commit comments