Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/actions/validate-sdk/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ runs:
shell: bash
run: npm run build

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

- name: Install examples dependencies
shell: bash
Expand All @@ -30,7 +30,7 @@ runs:
- name: Typecheck examples root
shell: bash
working-directory: examples
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 '*.ts'
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 *.ts

- name: Install nextjs-example dependencies
shell: bash
Expand All @@ -44,4 +44,4 @@ runs:

- name: Run tests
shell: bash
run: npm test
run: npx vitest
4 changes: 2 additions & 2 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ management:
docVersion: 1.0.0
speakeasyVersion: 1.642.1
generationVersion: 2.731.4
releaseVersion: 0.0.1-beta.12
configChecksum: e6c04301f8a6286cc4a63b775130ead9
releaseVersion: 0.0.1-beta.14
configChecksum: 6639946bd9c6d122465a7506943348f4
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
published: true
Expand Down
4 changes: 2 additions & 2 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: false
typescript:
version: 0.0.1-beta.12
version: 0.0.1-beta.14
acceptHeaderEnum: false
additionalDependencies:
dependencies: {}
devDependencies:
'@types/node': ^22.13.12
vitest: ^3.2.4
dotenv: ^16.4.7
vitest: ^3.2.4
peerDependencies: {}
additionalPackageJSON: {}
author: OpenRouter
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ targets:
sourceRevisionDigest: sha256:6dd11a2a3212f61a00c0e0b6309aaf39cc3d2575493aea2b54aafb0cf187d272
sourceBlobDigest: sha256:e46f40a6a57e7eb1c21a40c388f46b9b7b36ed0dd9ea78d480d300d83ace2fe3
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
codeSamplesRevisionDigest: sha256:54cedfffe13b1e73d8e277b9fcbc7f109d448d6131ae751d3a07640b9e952673
codeSamplesRevisionDigest: sha256:1d36752fa1859baae015ab744eb16369c7c2a9d9de92e60135d98860d2ab4741
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
8 changes: 4 additions & 4 deletions examples/chatCompletions.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ async function streamingExample() {
let fullContent = "";

for await (const chunk of stream) {
if (chunk.data.choices && chunk.data.choices[0]?.delta?.content) {
const content = chunk.data.choices[0].delta.content;
if (chunk.choices && chunk.choices[0]?.delta?.content) {
const content = chunk.choices[0].delta.content;
process.stdout.write(content);
fullContent += content;
}

if (chunk.data.usage) {
console.log("\n\nStream usage:", chunk.data.usage);
if (chunk.usage) {
console.log("\n\nStream usage:", chunk.usage);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6942,4 +6942,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/nextjs-example/src/app/(app)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";

export default function Page({ searchParams }: PageProps<"/">) {
export default function Page({ searchParams }: { searchParams: Promise<{ code?: string; error?: string }> }) {
const [connectionState, setConnectionState] = useState<
"disconnected" | "connecting" | "connected" | "initializing" | "error"
>("initializing");
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@openrouter/sdk",
"version": "0.0.1-beta.12",
"version": "0.0.1-beta.14",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
18 changes: 16 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/sdk",
"version": "0.0.1-beta.12",
"version": "0.0.1-beta.14",
"author": "OpenRouter",
"type": "module",
"main": "./esm/index.js",
Expand Down Expand Up @@ -72,6 +72,7 @@
"@tanstack/react-query": "^5.61.4",
"@types/node": "^22.13.12",
"@types/react": "^18.3.12",
"dotenv": "^16.4.7",
"eslint": "^9.19.0",
"globals": "^15.14.0",
"typescript": "~5.8.3",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "0.0.1-beta.12",
sdkVersion: "0.0.1-beta.14",
genVersion: "2.731.4",
userAgent:
"speakeasy-sdk/typescript 0.0.1-beta.12 2.731.4 1.0.0 @openrouter/sdk",
"speakeasy-sdk/typescript 0.0.1-beta.14 2.731.4 1.0.0 @openrouter/sdk",
} as const;
Loading