Skip to content

Commit 2009531

Browse files
committed
refactor: rename getResponse to callModel
Renamed all getResponse references to callModel throughout the codebase.
1 parent aedcf10 commit 2009531

File tree

11 files changed

+43
-43
lines changed

11 files changed

+43
-43
lines changed

.speakeasy/gen.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ management:
55
docVersion: 1.0.0
66
speakeasyVersion: 1.659.0
77
generationVersion: 2.755.9
8-
releaseVersion: 0.1.20
9-
configChecksum: 3b36d5eb8cadc98f73a43f78313bb65c
8+
releaseVersion: 0.1.21
9+
configChecksum: 4286d15d32043f4bd7ddb46f01a379cf
1010
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
1212
published: true

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ generation:
3030
generateNewTests: true
3131
skipResponseBodyAssertions: false
3232
typescript:
33-
version: 0.1.20
33+
version: 0.1.21
3434
acceptHeaderEnum: false
3535
additionalDependencies:
3636
dependencies: {}

.speakeasy/workflow.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ targets:
1414
sourceRevisionDigest: sha256:ffe0e925561a55a1b403667fe33bb3158e05892ef1e66f56211544c9a890b301
1515
sourceBlobDigest: sha256:18aa7b22686c2f559af1062fea408a9f80146231027ed1fd62b68df38c71f65d
1616
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:db1e3aba5b14308995859d6339ac902dbbe644d474c4ac3a998db42bc0431453
17+
codeSamplesRevisionDigest: sha256:04d3ae0786efbdcdcb5ab21ece1ca0d31e37a4c44a7a5e9cea339ef962604228
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

examples/tools-example.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* 3. Results sent back to the model
99
* 4. Process repeats until no more tool calls (up to maxToolRounds)
1010
*
11-
* The API is simple: just call getResponse() with tools, and await the result.
11+
* The API is simple: just call callModel() with tools, and await the result.
1212
* Tools are executed transparently before getMessage() or getText() returns!
1313
*
1414
* maxToolRounds can be:
@@ -63,7 +63,7 @@ async function basicToolExample() {
6363
},
6464
};
6565

66-
const response = client.getResponse({
66+
const response = client.callModel({
6767
model: "openai/gpt-4o",
6868
input: "What's the weather like in San Francisco?",
6969
tools: [weatherTool],
@@ -140,7 +140,7 @@ async function generatorToolExample() {
140140
},
141141
};
142142

143-
const response = client.getResponse({
143+
const response = client.callModel({
144144
model: "openai/gpt-4o",
145145
input: "Process this data: hello world",
146146
tools: [processingTool],
@@ -183,7 +183,7 @@ async function manualToolExample() {
183183
},
184184
};
185185

186-
const response = client.getResponse({
186+
const response = client.callModel({
187187
model: "openai/gpt-4o",
188188
input: "What is 25 * 4 + 10?",
189189
tools: [calculatorTool],
@@ -245,7 +245,7 @@ async function streamingToolCallsExample() {
245245
},
246246
};
247247

248-
const response = client.getResponse({
248+
const response = client.callModel({
249249
model: "openai/gpt-4o",
250250
input: "Search for information about TypeScript",
251251
tools: [searchTool],
@@ -311,7 +311,7 @@ async function multipleToolsExample() {
311311
},
312312
];
313313

314-
const response = client.getResponse({
314+
const response = client.callModel({
315315
model: "openai/gpt-4o",
316316
input: "What time is it and what's the weather in New York?",
317317
tools,

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "@openrouter/sdk",
5-
"version": "0.1.20",
5+
"version": "0.1.21",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/sdk",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"author": "OpenRouter",
55
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
66
"keywords": [
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ import { convertEnhancedToolsToAPIFormat } from "../lib/tool-executor.js";
3030
* import { z } from 'zod';
3131
*
3232
* // Simple text extraction
33-
* const response = openrouter.getResponse({
33+
* const response = openrouter.callModel({
3434
* model: "openai/gpt-4",
3535
* input: "Hello!"
3636
* });
3737
* const text = await response.getText();
3838
* console.log(text);
3939
*
4040
* // With tools (automatic execution)
41-
* const response = openrouter.getResponse({
41+
* const response = openrouter.callModel({
4242
* model: "openai/gpt-4",
4343
* input: "What's the weather in SF?",
4444
* tools: [{
@@ -72,7 +72,7 @@ import { convertEnhancedToolsToAPIFormat } from "../lib/tool-executor.js";
7272
* }
7373
* ```
7474
*/
75-
export function getResponse(
75+
export function callModel(
7676
client: OpenRouterCore,
7777
request: Omit<models.OpenResponsesRequest, "stream" | "tools"> & {
7878
tools?: EnhancedTool[] | models.OpenResponsesRequest["tools"];

src/lib/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
6969
export const SDK_METADATA = {
7070
language: "typescript",
7171
openapiDocVersion: "1.0.0",
72-
sdkVersion: "0.1.20",
72+
sdkVersion: "0.1.21",
7373
genVersion: "2.755.9",
74-
userAgent: "speakeasy-sdk/typescript 0.1.20 2.755.9 1.0.0 @openrouter/sdk",
74+
userAgent: "speakeasy-sdk/typescript 0.1.21 2.755.9 1.0.0 @openrouter/sdk",
7575
} as const;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as dotenv from "dotenv";
66

77
dotenv.config();
88

9-
describe("Enhanced Tool Support for getResponse", () => {
9+
describe("Enhanced Tool Support for callModel", () => {
1010
let client: OpenRouter;
1111

1212
beforeAll(() => {
@@ -425,7 +425,7 @@ describe("Enhanced Tool Support for getResponse", () => {
425425
},
426426
};
427427

428-
const response = await client.getResponse({
428+
const response = await client.callModel({
429429
model: "openai/gpt-4o",
430430
messages: [
431431
{
@@ -461,7 +461,7 @@ describe("Enhanced Tool Support for getResponse", () => {
461461
},
462462
};
463463

464-
const response = await client.getResponse(
464+
const response = await client.callModel(
465465
{
466466
model: "openai/gpt-4o",
467467
messages: [

0 commit comments

Comments
 (0)