Skip to content

Commit f893460

Browse files
Update 2025-07-18 (friendliai#68)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 1cc9dc6 commit f893460

File tree

71 files changed

+1259
-2117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1259
-2117
lines changed

.speakeasy/gen.lock

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
lockVersion: 2.0.0
22
id: 37076cef-26b6-4da9-bb49-e710061cab77
33
management:
4-
docChecksum: 5fb1bdfa1fc4aa2481b778de307dd114
4+
docChecksum: 8daaf6ff623b2023140e03b8f50c0ee9
55
docVersion: 0.1.0
6-
speakeasyVersion: 1.561.0
7-
generationVersion: 2.628.0
8-
releaseVersion: 0.10.5
9-
configChecksum: 267a1af63ed53a1a736533224ed084be
6+
speakeasyVersion: 1.582.0
7+
generationVersion: 2.657.1
8+
releaseVersion: 0.10.6
9+
configChecksum: 510a7b4aed60c8754ec84d48fc5af884
1010
repoURL: https://github.com/friendliai/friendli-python.git
1111
installationURL: https://github.com/friendliai/friendli-python.git
1212
published: true
1313
features:
1414
python:
1515
additionalDependencies: 1.0.0
1616
constsAndDefaults: 1.0.5
17-
core: 5.19.3
17+
core: 5.19.4
1818
defaultEnabledRetries: 0.2.0
1919
enumUnions: 0.1.0
2020
envVarSecurityUsage: 0.3.2
21-
examples: 3.0.1
21+
examples: 3.0.2
2222
flatRequests: 1.0.1
2323
flattening: 3.1.1
2424
globalSecurity: 3.0.3
@@ -39,7 +39,6 @@ features:
3939
uploadStreams: 1.0.0
4040
generatedFiles:
4141
- .gitattributes
42-
- .python-version
4342
- .vscode/settings.json
4443
- USAGE.md
4544
- docs/models/acceleratorrequirement.md
@@ -245,6 +244,7 @@ generatedFiles:
245244
- docs/models/serverlessknowledgeretrievalsuccess.md
246245
- docs/models/serverlessknowledgeretrieverequest.md
247246
- docs/models/serverlessmodellistsuccess.md
247+
- docs/models/serverlesspriceunittype.md
248248
- docs/models/serverlesstokenizationbody.md
249249
- docs/models/serverlesstokenizationrequest.md
250250
- docs/models/serverlesstokenizationsuccess.md
@@ -463,6 +463,7 @@ generatedFiles:
463463
- src/friendli_core/models/fileinfo.py
464464
- src/friendli_core/models/fileinituploadrequest.py
465465
- src/friendli_core/models/fileinituploadresponse.py
466+
- src/friendli_core/models/friendlicoreerror.py
466467
- src/friendli_core/models/function.py
467468
- src/friendli_core/models/functionality.py
468469
- src/friendli_core/models/functionresult.py
@@ -488,6 +489,7 @@ generatedFiles:
488489
- src/friendli_core/models/listversionsresponse.py
489490
- src/friendli_core/models/message.py
490491
- src/friendli_core/models/modelcatalogresponseitem.py
492+
- src/friendli_core/models/no_response_error.py
491493
- src/friendli_core/models/otherbuiltintool.py
492494
- src/friendli_core/models/pricingmodel.py
493495
- src/friendli_core/models/responseformat.py
@@ -496,6 +498,7 @@ generatedFiles:
496498
- src/friendli_core/models/responseformatjsonschemaschema.py
497499
- src/friendli_core/models/responseformatregex.py
498500
- src/friendli_core/models/responseformattext.py
501+
- src/friendli_core/models/responsevalidationerror.py
499502
- src/friendli_core/models/sdkerror.py
500503
- src/friendli_core/models/security.py
501504
- src/friendli_core/models/serverlesschatcompleteop.py
@@ -513,6 +516,7 @@ generatedFiles:
513516
- src/friendli_core/models/serverlessknowledgeretrievalsuccess.py
514517
- src/friendli_core/models/serverlessknowledgeretrieveop.py
515518
- src/friendli_core/models/serverlessmodellistsuccess.py
519+
- src/friendli_core/models/serverlesspriceunittype.py
516520
- src/friendli_core/models/serverlesstokenizationbody.py
517521
- src/friendli_core/models/serverlesstokenizationop.py
518522
- src/friendli_core/models/serverlesstokenizationsuccess.py
@@ -574,6 +578,7 @@ generatedFiles:
574578
- src/friendli_core/utils/retries.py
575579
- src/friendli_core/utils/security.py
576580
- src/friendli_core/utils/serializers.py
581+
- src/friendli_core/utils/unmarshal_json_response.py
577582
- src/friendli_core/utils/url.py
578583
- src/friendli_core/utils/values.py
579584
examples:
@@ -901,7 +906,7 @@ examples:
901906
speakeasy-default-serverless-model-list:
902907
responses:
903908
"200":
904-
application/json: {"data": [{"context_length": 373077, "created": 125077, "description": "as evenly adjourn", "functionality": {"parallel_tool_call": false, "tool_call": false, "structured_output": true}, "hugging_face_url": "https://enchanted-coliseum.org/", "id": "<id>", "license": "https://dapper-hutch.net/", "max_completion_tokens": 324596, "name": "<value>", "policy": "https://different-bookend.net/", "pricing": {"input": 8164.42, "output": 3961.62}}]}
909+
application/json: {"data": [{"context_length": 373077, "created": 125077, "description": "as evenly adjourn", "functionality": {"parallel_tool_call": false, "tool_call": false, "structured_output": true}, "hugging_face_url": "https://enchanted-coliseum.org/", "id": "<id>", "license": "https://dapper-hutch.net/", "max_completion_tokens": 324596, "name": "<value>", "policy": "https://different-bookend.net/", "pricing": {"input": 8164.42, "output": 3961.62, "response_time": 0}}]}
905910
create_dataset:
906911
Example:
907912
requestBody:

.speakeasy/gen.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ generation:
1616
auth:
1717
oAuth2ClientCredentialsEnabled: true
1818
oAuth2PasswordEnabled: true
19+
tests:
20+
generateTests: true
21+
generateNewTests: false
22+
skipResponseBodyAssertions: false
1923
python:
20-
version: 0.10.5
24+
version: 0.10.6
2125
additionalDependencies:
2226
dev: {}
2327
main: {}

.speakeasy/workflow.lock

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
speakeasyVersion: 1.561.0
1+
speakeasyVersion: 1.582.0
22
sources:
33
Friendli-API-Schema:
44
sourceNamespace: friendli-api-schema
5-
sourceRevisionDigest: sha256:b53e84202ecdd6ce62ce49f8967fda993925a800f0c433354771768019dbb9b0
6-
sourceBlobDigest: sha256:7378ae2001e160333f552ac6125994182484356e67de2737b0a44d1ca7316c7d
5+
sourceRevisionDigest: sha256:5bee96e7e73e502a5b66d36c463cf18471e8735c8d7f4bda1bced6147d7873b1
6+
sourceBlobDigest: sha256:612581297b6ff9c410b7d717a17ff3cc6b7d424538f376d4bcaa05a51a2c8f4d
77
tags:
88
- latest
9+
- speakeasy-sdk-regen-1752626006
910
targets:
1011
friendli:
1112
source: Friendli-API-Schema
1213
sourceNamespace: friendli-api-schema
13-
sourceRevisionDigest: sha256:b53e84202ecdd6ce62ce49f8967fda993925a800f0c433354771768019dbb9b0
14-
sourceBlobDigest: sha256:7378ae2001e160333f552ac6125994182484356e67de2737b0a44d1ca7316c7d
14+
sourceRevisionDigest: sha256:5bee96e7e73e502a5b66d36c463cf18471e8735c8d7f4bda1bced6147d7873b1
15+
sourceBlobDigest: sha256:612581297b6ff9c410b7d717a17ff3cc6b7d424538f376d4bcaa05a51a2c8f4d
1516
codeSamplesNamespace: friendli-api-schema-code-samples
16-
codeSamplesRevisionDigest: sha256:a219085d91c2b218e13cd62120360559dfeae7d0d3a3c74edf1a77add9e7b4ba
17+
codeSamplesRevisionDigest: sha256:4f3290c824474c8e21c6a47297dc3f336c4266bc588b5919d71cb985b64b3074
1718
workflow:
1819
workflowVersion: 1.0.0
1920
speakeasyVersion: latest

README.md

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ from friendli import SyncFriendli
269269
with SyncFriendli(
270270
token=os.getenv("FRIENDLI_TOKEN", ""),
271271
) as friendli:
272-
res = friendli.dedicated.chat.complete(
272+
res = friendli.container.chat.complete(
273273
messages=[
274274
{
275275
"content": "You are a helpful assistant.",
@@ -427,7 +427,7 @@ with SyncFriendli(
427427
operations. These operations will expose the stream as [Generator][generator] that
428428
can be consumed using a simple `for` loop. The loop will
429429
terminate when the server no longer has any events to send and closes the
430-
underlying connection.
430+
underlying connection.
431431

432432
The stream is also a [Context Manager][context-manager] and can be used with the `with` statement and will close the
433433
underlying connection when the context is exited.
@@ -513,7 +513,7 @@ from friendli.utils import BackoffStrategy, RetryConfig
513513
with SyncFriendli(
514514
token=os.getenv("FRIENDLI_TOKEN", ""),
515515
) as friendli:
516-
res = friendli.dedicated.chat.complete(
516+
res = friendli.container.chat.complete(
517517
messages=[
518518
{
519519
"content": "You are a helpful assistant.",
@@ -545,7 +545,7 @@ with SyncFriendli(
545545
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
546546
token=os.getenv("FRIENDLI_TOKEN", ""),
547547
) as friendli:
548-
res = friendli.dedicated.chat.complete(
548+
res = friendli.container.chat.complete(
549549
messages=[
550550
{
551551
"content": "You are a helpful assistant.",
@@ -569,29 +569,22 @@ with SyncFriendli(
569569
<!-- Start Error Handling [errors] -->
570570
## Error Handling
571571

572-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
573-
574-
By default, an API error will raise a models.SDKError exception, which has the following properties:
572+
[`FriendliCoreError`](./src/friendli/models/friendlicoreerror.py) is the base class for all HTTP error responses. It has the following properties:
575573

576-
| Property | Type | Description |
577-
|-----------------|------------------|-----------------------|
578-
| `.status_code` | *int* | The HTTP status code |
579-
| `.message` | *str* | The error message |
580-
| `.raw_response` | *httpx.Response* | The raw HTTP response |
581-
| `.body` | *str* | The response content |
582-
583-
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `delete` method may raise the following exceptions:
584-
585-
| Error Type | Status Code | Content Type |
586-
| -------------------------- | ----------- | ---------------- |
587-
| models.HTTPValidationError | 422 | application/json |
588-
| models.SDKError | 4XX, 5XX | \*/\* |
574+
| Property | Type | Description |
575+
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
576+
| `err.message` | `str` | Error message |
577+
| `err.status_code` | `int` | HTTP response status code eg `404` |
578+
| `err.headers` | `httpx.Headers` | HTTP response headers |
579+
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
580+
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
581+
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
589582

590583
### Example
591-
592584
```python
593585
import os
594586

587+
import friendli
595588
from friendli import SyncFriendli, models
596589

597590
with SyncFriendli(
@@ -604,13 +597,40 @@ with SyncFriendli(
604597
# Handle response
605598
print(res)
606599

607-
except models.HTTPValidationError as e:
608-
# handle e.data: models.HTTPValidationErrorData
609-
raise (e)
610-
except models.SDKError as e:
611-
# handle exception
612-
raise (e)
600+
except models.FriendliCoreError as e:
601+
# The base class for HTTP error responses
602+
print(e.message)
603+
print(e.status_code)
604+
print(e.body)
605+
print(e.headers)
606+
print(e.raw_response)
607+
608+
# Depending on the method different errors may be thrown
609+
if isinstance(e, models.HTTPValidationError):
610+
print(e.data.detail) # Optional[List[friendli.ValidationError]]
613611
```
612+
613+
### Error Classes
614+
**Primary error:**
615+
* [`FriendliCoreError`](./src/friendli/models/friendlicoreerror.py): The base class for HTTP error responses.
616+
617+
<details><summary>Less common errors (6)</summary>
618+
619+
<br />
620+
621+
**Network errors:**
622+
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
623+
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
624+
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
625+
626+
627+
**Inherit from [`FriendliCoreError`](./src/friendli/models/friendlicoreerror.py)**:
628+
* [`HTTPValidationError`](./src/friendli/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 21 of 57 methods.*
629+
* [`ResponseValidationError`](./src/friendli/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
630+
631+
</details>
632+
633+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
614634
<!-- End Error Handling [errors] -->
615635

616636
<!-- Start Server Selection [server] -->

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,14 @@ Based on:
143143
### Generated
144144
- [python v0.10.3] .
145145
### Releases
146-
- [PyPI v0.10.3] https://pypi.org/project/friendli-core/0.10.3 - .
146+
- [PyPI v0.10.3] https://pypi.org/project/friendli-core/0.10.3 - .
147+
148+
## 2025-07-18 00:33:03
149+
### Changes
150+
Based on:
151+
- OpenAPI Doc
152+
- Speakeasy CLI 1.582.0 (2.657.1) https://github.com/speakeasy-api/speakeasy
153+
### Generated
154+
- [python v0.10.6] .
155+
### Releases
156+
- [PyPI v0.10.6] https://pypi.org/project/friendli-core/0.10.6 - .

0 commit comments

Comments
 (0)