Skip to content

Commit 20279fd

Browse files
committed
fix broken tests, and improve types
1 parent 24351dc commit 20279fd

36 files changed

+499
-316
lines changed

.github/actions/validate-sdk/action.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ runs:
2323
shell: bash
2424
run: npm run build
2525

26-
# - name: Typecheck tests directory
27-
# shell: bash
28-
# run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 tests/**/*.ts
26+
- name: Typecheck tests directory
27+
shell: bash
28+
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 tests/**/*.ts
2929

3030
- name: Install examples dependencies
3131
shell: bash
3232
working-directory: examples
3333
run: npm install
3434

3535
# TODO: Re-enable when Speakeasy fixes generated code type errors
36-
# - name: Typecheck examples root
37-
# shell: bash
38-
# working-directory: examples
39-
# run: npx tsc
36+
- name: Typecheck examples root
37+
shell: bash
38+
working-directory: examples
39+
run: npx tsc
4040

4141
- name: Install nextjs-example dependencies
4242
shell: bash

.speakeasy/gen.lock

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 8b6cd71c-ea04-44da-af45-e43968b5928d
33
management:
4-
docChecksum: 2e56a000b1486d774bf299b99ef6d4ef
4+
docChecksum: 591fccdc6b495b1230644174853f9113
55
docVersion: 1.0.0
66
speakeasyVersion: 1.666.0
77
generationVersion: 2.768.0
8-
releaseVersion: 0.2.2
9-
configChecksum: eab7e61a24e830c367d7deebb355351e
8+
releaseVersion: 0.2.5
9+
configChecksum: 324815634003cbee850769ac972293be
1010
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
1212
published: true
@@ -108,7 +108,6 @@ generatedFiles:
108108
- docs/models/costdetails.md
109109
- docs/models/createchargerequest.md
110110
- docs/models/datacollection.md
111-
- docs/models/debug.md
112111
- docs/models/defaultparameters.md
113112
- docs/models/edgenetworktimeoutresponseerrordata.md
114113
- docs/models/effort.md
@@ -1505,7 +1504,7 @@ examples:
15051504
use_rss_chat_links: "<value>"
15061505
responses:
15071506
"200":
1508-
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1507+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
15091508
application/rss+xml: "<value>"
15101509
default:
15111510
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
@@ -1517,7 +1516,7 @@ examples:
15171516
speakeasy-default-list-models-user:
15181517
responses:
15191518
"200":
1520-
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1519+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
15211520
default:
15221521
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
15231522
"401":
@@ -1532,7 +1531,7 @@ examples:
15321531
slug: "<value>"
15331532
responses:
15341533
"200":
1535-
application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]}}
1534+
application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]}}
15361535
default:
15371536
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
15381537
4XX:
@@ -1743,7 +1742,7 @@ examples:
17431742
speakeasy-default-list-embeddings-models:
17441743
responses:
17451744
"200":
1746-
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1745+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
17471746
"400":
17481747
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
17491748
"500":

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ generation:
3131
skipResponseBodyAssertions: false
3232
preApplyUnionDiscriminators: true
3333
typescript:
34-
version: 0.2.2
34+
version: 0.2.5
3535
acceptHeaderEnum: false
3636
additionalDependencies:
3737
dependencies: {}

.speakeasy/in.openapi.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,11 @@ components:
35353535
performed.
35363536
example: price
35373537
BigNumberUnion:
3538-
type: number
3538+
anyOf:
3539+
- type: number
3540+
- type: string
3541+
- type: number
3542+
example: 1000
35393543
description: A value in string or number format that is a large number
35403544
example: 1000
35413545
OpenResponsesRequest:
@@ -5191,11 +5195,6 @@ components:
51915195
- type: 'null'
51925196
user:
51935197
type: string
5194-
debug:
5195-
type: object
5196-
properties:
5197-
echo_upstream_body:
5198-
type: boolean
51995198
required:
52005199
- messages
52015200
ChatResponseChoice:

.speakeasy/out.openapi.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,11 @@ components:
35543554
example: price
35553555
x-speakeasy-unknown-values: allow
35563556
BigNumberUnion:
3557-
type: number
3557+
anyOf:
3558+
- type: number
3559+
- type: string
3560+
- type: number
3561+
example: 1000
35583562
description: A value in string or number format that is a large number
35593563
example: 1000
35603564
OpenResponsesRequest:
@@ -5215,11 +5219,6 @@ components:
52155219
- type: 'null'
52165220
user:
52175221
type: string
5218-
debug:
5219-
type: object
5220-
properties:
5221-
echo_upstream_body:
5222-
type: boolean
52235222
required:
52245223
- messages
52255224
ChatResponseChoice:

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ speakeasyVersion: 1.666.0
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
5-
sourceRevisionDigest: sha256:cd1857f445240e3746f1dc3f6bba496a03fc6b442fd91ab5797dd739dfa4059f
6-
sourceBlobDigest: sha256:2c87fff91b43230ee61055b32842695d123b7936b016aa136af01c86ecb4b7bb
5+
sourceRevisionDigest: sha256:430fa9a22e960fd04a393c99eb3c967b11b5fbda6b19a104bfcd745efe887df3
6+
sourceBlobDigest: sha256:c65ea29dcae3bb0b31cba1f207741a8a835620bc6e8921e614a7c371055d850c
77
tags:
88
- latest
99
- 1.0.0
1010
targets:
1111
openrouter:
1212
source: OpenRouter API
1313
sourceNamespace: open-router-chat-completions-api
14-
sourceRevisionDigest: sha256:cd1857f445240e3746f1dc3f6bba496a03fc6b442fd91ab5797dd739dfa4059f
15-
sourceBlobDigest: sha256:2c87fff91b43230ee61055b32842695d123b7936b016aa136af01c86ecb4b7bb
14+
sourceRevisionDigest: sha256:430fa9a22e960fd04a393c99eb3c967b11b5fbda6b19a104bfcd745efe887df3
15+
sourceBlobDigest: sha256:c65ea29dcae3bb0b31cba1f207741a8a835620bc6e8921e614a7c371055d850c
1616
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:470a888dfd79bc1442bde84817b53d3747b6c63d6527af44f75a275ad377b8a9
17+
codeSamplesRevisionDigest: sha256:a59d16ba1ee08055e7b981bb90b26bf279ce9e5e90be6c8233240ff5841ecc90
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: 1.666.0

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"useParseIntRadix": "error"
117117
},
118118
"suspicious": {
119-
"noExplicitAny": "error",
119+
"noExplicitAny": "warn",
120120
"noArrayIndexKey": "off",
121121
"noAssignInExpressions": "error",
122122
"noAsyncPromiseExecutor": "off",

docs/models/chatgenerationparams.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ let value: ChatGenerationParams = {
4040
| `toolChoice` | *any* | :heavy_minus_sign: | N/A |
4141
| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A |
4242
| `topP` | *number* | :heavy_minus_sign: | N/A |
43-
| `user` | *string* | :heavy_minus_sign: | N/A |
44-
| `debug` | [models.Debug](../models/debug.md) | :heavy_minus_sign: | N/A |
43+
| `user` | *string* | :heavy_minus_sign: | N/A |

docs/models/debug.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/models/listendpointsresponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ let value: ListEndpointsResponse = {
3030
modelName: "GPT-4",
3131
contextLength: 8192,
3232
pricing: {
33-
prompt: 0.00003,
34-
completion: 0.00006,
33+
prompt: "0.00003",
34+
completion: "0.00006",
3535
},
3636
providerName: "OpenAI",
3737
tag: "openai",

0 commit comments

Comments
 (0)