offrouter-openrouter 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# offrouter-openrouter
|
|
2
|
+
|
|
3
|
+
OpenRouter provider package for OffRouter.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install offrouter-openrouter
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createOpenRouterAdapter } from "offrouter-openrouter";
|
|
15
|
+
|
|
16
|
+
const adapter = createOpenRouterAdapter({
|
|
17
|
+
apiKey: process.env.OPENROUTER_API_KEY,
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Provider activation names: `OPENROUTER_API_KEY`.
|
|
22
|
+
|
|
23
|
+
The package delegates transport and policy behavior to `offrouter-core`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CreateBuiltinOpenAiCompatibleAdapterOptions } from "offrouter-core";
|
|
2
|
+
export declare const PACKAGE_NAME: "offrouter-openrouter";
|
|
3
|
+
export declare const PROVIDER_ID: "openrouter";
|
|
4
|
+
export declare const DEFAULT_BASE_URL: string;
|
|
5
|
+
export declare const ENV_NAMES: readonly string[];
|
|
6
|
+
export type OpenRouterAdapterOptions = CreateBuiltinOpenAiCompatibleAdapterOptions;
|
|
7
|
+
export declare function createOpenRouterAdapter(options?: OpenRouterAdapterOptions): import("offrouter-core").OpenAiCompatibleAdapter;
|
|
8
|
+
export declare const createAdapter: typeof createOpenRouterAdapter;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,2CAA2C,EACjD,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,YAAY,EAAG,sBAA+B,CAAC;AAC5D,eAAO,MAAM,WAAW,EAAG,YAAqB,CAAC;AACjD,eAAO,MAAM,gBAAgB,QAC0B,CAAC;AACxD,eAAO,MAAM,SAAS,mBAAkD,CAAC;AAEzE,MAAM,MAAM,wBAAwB,GAClC,2CAA2C,CAAC;AAE9C,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAA6B,oDAGvC;AAED,eAAO,MAAM,aAAa,gCAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createBuiltinOpenAiCompatibleAdapter, getBuiltinProvider, openAiCompatibleCredentialEnvNames, } from "offrouter-core";
|
|
2
|
+
export const PACKAGE_NAME = "offrouter-openrouter";
|
|
3
|
+
export const PROVIDER_ID = "openrouter";
|
|
4
|
+
export const DEFAULT_BASE_URL = getBuiltinProvider(PROVIDER_ID)?.defaultBaseUrl ?? "";
|
|
5
|
+
export const ENV_NAMES = openAiCompatibleCredentialEnvNames(PROVIDER_ID);
|
|
6
|
+
export function createOpenRouterAdapter(options = {}) {
|
|
7
|
+
return createBuiltinOpenAiCompatibleAdapter(PROVIDER_ID, options);
|
|
8
|
+
}
|
|
9
|
+
export const createAdapter = createOpenRouterAdapter;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EACpC,kBAAkB,EAClB,kCAAkC,GAEnC,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,sBAA+B,CAAC;AAC5D,MAAM,CAAC,MAAM,WAAW,GAAG,YAAqB,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAC3B,kBAAkB,CAAC,WAAW,CAAC,EAAE,cAAc,IAAI,EAAE,CAAC;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,kCAAkC,CAAC,WAAW,CAAC,CAAC;AAKzE,MAAM,UAAU,uBAAuB,CACrC,UAAoC,EAAE;IAEtC,OAAO,oCAAoC,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,uBAAuB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "offrouter-openrouter",
|
|
3
|
+
"version": "0.33.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc -p tsconfig.json"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"offrouter-core": "0.33.0"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
23
|
+
]
|
|
24
|
+
}
|