Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.462.2
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Jan 4, 2025
1 parent 9c9b070 commit 34ae7ac
Show file tree
Hide file tree
Showing 374 changed files with 10,902 additions and 571 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/react-query
/.speakeasy/reports
/models
/models/errors
/types
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
**/*
!/FUNCTIONS.md
!/RUNTIMES.md
!/REACT_QUERY.md
!/**/*.ts
!/**/*.js
!/**/*.map
Expand Down
21 changes: 11 additions & 10 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
lockVersion: 2.0.0
id: 61a4ac00-e7ed-4a10-9e0f-47f8aef9702c
management:
docChecksum: c58ce1a8f4761676d0ec62b40ce3b5af
docChecksum: e1f306b5ba0a01e1785143532d301bf4
docVersion: 2.3.0
speakeasyVersion: 1.421.1
generationVersion: 2.438.15
releaseVersion: 0.0.5
configChecksum: 20495d52a63fb99b59bfcbbc62b92c6b
speakeasyVersion: 1.462.2
generationVersion: 2.486.1
releaseVersion: 0.1.0
configChecksum: 7368fbdfd96840ba79324b02deebb238
repoURL: https://github.com/argotdev/speakeasy-sdk.git
installationURL: https://github.com/argotdev/speakeasy-sdk
published: true
features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.18.2
core: 3.18.12
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
devContainers: 2.90.0
downloadStreams: 0.1.1
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.1
globalSecurity: 2.82.11
envVarSecurityUsage: 0.1.2
globalSecurity: 2.82.12
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.82.4
nullables: 0.1.0
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
unions: 2.85.7
sdkHooks: 0.2.0
unions: 2.85.8
uploadStreams: 0.1.0
generatedFiles:
- .devcontainer/README.md
Expand Down Expand Up @@ -1917,3 +1917,4 @@ examples:
application/json: {"object": "organization.project.api_key.deleted", "id": "<id>", "deleted": false}
"400":
application/json: {"error": {"code": "<value>", "message": "<value>", "param": "<value>", "type": "<value>"}}
generatedTests: {}
5 changes: 4 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ generation:
requestResponseComponentNamesFeb2024: true
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 0.0.5
version: 0.1.0
additionalDependencies:
dependencies: {}
devDependencies: {}
peerDependencies: {}
additionalPackageJSON: {}
author: Speakeasy
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
enableReactQuery: false
enumFormat: union
envVarPrefix: ARGOTOPENAI
flattenGlobalSecurity: true
Expand Down
21 changes: 15 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
speakeasyVersion: 1.421.1
speakeasyVersion: 1.462.2
sources:
ArgotOpenAi-OAS:
sourceNamespace: argot-open-ai-oas
sourceRevisionDigest: sha256:57762a25bf2b9db92394f493016221caac15a961a8b0d0daf781fbf169cf11de
sourceBlobDigest: sha256:1ac004496342b737f8cbb62c2de296ce98c3851f1082d3b6d73d7f312b6d247e
sourceRevisionDigest: sha256:1cf9f2b2735ce891126bb1eb1aa9256826a291a80ca2b07adb272c46e71a765c
sourceBlobDigest: sha256:e89de7a85a3dfb63c1563aefa16ae940ce3d67eaa50d2d718fe9bedb74e902bb
tags:
- latest
- main
- speakeasy-sdk-regen-1729907398
- 2.3.0
targets:
argot-open-ai:
source: ArgotOpenAi-OAS
sourceNamespace: argot-open-ai-oas
sourceRevisionDigest: sha256:57762a25bf2b9db92394f493016221caac15a961a8b0d0daf781fbf169cf11de
sourceBlobDigest: sha256:1ac004496342b737f8cbb62c2de296ce98c3851f1082d3b6d73d7f312b6d247e
sourceRevisionDigest: sha256:1cf9f2b2735ce891126bb1eb1aa9256826a291a80ca2b07adb272c46e71a765c
sourceBlobDigest: sha256:e89de7a85a3dfb63c1563aefa16ae940ce3d67eaa50d2d718fe9bedb74e902bb
codeSamplesNamespace: argot-open-ai-oas-typescript-code-samples
codeSamplesRevisionDigest: sha256:6aa316ebc0883131949bd37cec5b736e48fad731b4786cd10ecd79f3929f6010
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand All @@ -29,3 +32,9 @@ workflow:
publish:
npm:
token: $npm_token
codeSamples:
registry:
location: registry.speakeasyapi.dev/argot/argot/argot-open-ai-oas-typescript-code-samples
labelOverride:
fixedValue: Typescript (SDK)
blocking: false
28 changes: 17 additions & 11 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
ArgotOpenAi-OAS:
inputs:
- location: openai-openapi.yaml
registry:
location: registry.speakeasyapi.dev/argot/argot/argot-open-ai-oas
ArgotOpenAi-OAS:
inputs:
- location: openai-openapi.yaml
registry:
location: registry.speakeasyapi.dev/argot/argot/argot-open-ai-oas
targets:
argot-open-ai:
target: typescript
source: ArgotOpenAi-OAS
publish:
npm:
token: $npm_token
argot-open-ai:
target: typescript
source: ArgotOpenAi-OAS
publish:
npm:
token: $npm_token
codeSamples:
registry:
location: registry.speakeasyapi.dev/argot/argot/argot-open-ai-oas-typescript-code-samples
labelOverride:
fixedValue: Typescript (SDK)
blocking: false
136 changes: 41 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,24 @@ OpenAI API: The OpenAI REST API. Please see https://platform.openai.com/docs/api

<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
* [argot-open-ai](#argot-open-ai)
* [SDK Installation](#sdk-installation)
* [Requirements](#requirements)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Standalone functions](#standalone-functions)
* [File uploads](#file-uploads)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Custom HTTP Client](#custom-http-client)
* [Authentication](#authentication)
* [Debugging](#debugging)
* [Development](#development)
* [Maturity](#maturity)
* [Contributions](#contributions)

* [SDK Installation](#sdk-installation)
* [Requirements](#requirements)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Standalone functions](#standalone-functions)
* [File uploads](#file-uploads)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Custom HTTP Client](#custom-http-client)
* [Authentication](#authentication)
* [Debugging](#debugging)
<!-- End Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
Expand Down Expand Up @@ -664,24 +669,14 @@ run();
<!-- Start Error Handling [errors] -->
## Error Handling

All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`.
Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `modifyProject` method may throw the following errors:

If a HTTP request fails, an operation my also throw an error from the `models/errors/httpclienterrors.ts` module:
| Error Type | Status Code | Content Type |
| -------------------- | ----------- | ---------------- |
| errors.ErrorResponse | 400 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

| HTTP Client Error | Description |
| ---------------------------------------------------- | ---------------------------------------------------- |
| RequestAbortedError | HTTP request was aborted by the client |
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
| ConnectionError | HTTP client was unable to make a request to a server |
| InvalidRequestError | Any input used to create a request is invalid |
| UnexpectedClientError | Unrecognised or unexpected error |

In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `modifyProject` method may throw the following errors:

| Error Type | Status Code | Content Type |
| -------------------- | -------------------- | -------------------- |
| errors.ErrorResponse | 400 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |
If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`.

```typescript
import { ArgotOpenAi } from "argot-open-ai";
Expand All @@ -705,8 +700,9 @@ async function run() {
console.log(result);
} catch (err) {
switch (true) {
// The server response does not match the expected SDK schema
case (err instanceof SDKValidationError): {
// Validation errors can be pretty-printed
// Pretty-print will provide a human-readable multi-line error message
console.error(err.pretty());
// Raw value may also be inspected
console.error(err.rawValue);
Expand All @@ -718,6 +714,7 @@ async function run() {
return;
}
default: {
// Other errors such as network errors, see HTTPClientErrors for more details
throw err;
}
}
Expand All @@ -728,76 +725,25 @@ run();

```

Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging.
Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging.

In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module:

| HTTP Client Error | Description |
| ---------------------------------------------------- | ---------------------------------------------------- |
| RequestAbortedError | HTTP request was aborted by the client |
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
| ConnectionError | HTTP client was unable to make a request to a server |
| InvalidRequestError | Any input used to create a request is invalid |
| UnexpectedClientError | Unrecognised or unexpected error |
<!-- End Error Handling [errors] -->

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

### Select Server by Index

You can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://api.openai.com/v1` | None |

```typescript
import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
serverIdx: 0,
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
const result = await argotOpenAi.chat.createChatCompletion({
messages: [
{
content: "<value>",
role: "user",
},
{
content: [
{
type: "text",
text: "<value>",
},
{
type: "image_url",
imageUrl: {
url: "https://fixed-circumference.com",
},
},
],
role: "user",
},
{
role: "tool",
content: "<value>",
toolCallId: "<id>",
},
],
model: "gpt-4o",
n: 1,
temperature: 1,
topP: 1,
user: "user-1234",
});

// Handle the result
console.log(result);
}

run();

```


### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:

The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
```typescript
import { ArgotOpenAi } from "argot-open-ai";

Expand Down Expand Up @@ -906,9 +852,9 @@ const sdk = new ArgotOpenAi({ httpClient });

This SDK supports the following security scheme globally:

| Name | Type | Scheme | Environment Variable |
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
| `apiKeyAuth` | http | HTTP Bearer | `ARGOTOPENAI_API_KEY_AUTH` |
| Name | Type | Scheme | Environment Variable |
| ------------ | ---- | ----------- | -------------------------- |
| `apiKeyAuth` | http | HTTP Bearer | `ARGOTOPENAI_API_KEY_AUTH` |

To authenticate with the API the `apiKeyAuth` parameter must be set when initializing the SDK client instance. For example:
```typescript
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@ Based on:
### Generated
- [typescript v0.0.5] .
### Releases
- [NPM v0.0.5] https://www.npmjs.com/package/argot-open-ai/v/0.0.5 - .
- [NPM v0.0.5] https://www.npmjs.com/package/argot-open-ai/v/0.0.5 - .

## 2025-01-04 00:09:14
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.462.2 (2.486.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.1.0] .
### Releases
- [NPM v0.1.0] https://www.npmjs.com/package/argot-open-ai/v/0.1.0 - .
Loading

0 comments on commit 34ae7ac

Please sign in to comment.