Comparing version 1.0.0 to 1.0.1
@@ -12,3 +12,3 @@ import { OpenAIApi, CreateCompletionRequest, CreateChatCompletionRequest } from "openai"; | ||
export default function withAxiom(openai: OpenAIApi, opts?: WithAxiomOptions): OpenAIApi { | ||
export function withAxiom(openai: OpenAIApi, opts?: WithAxiomOptions): OpenAIApi { | ||
const axiom = new Client({ token: opts?.token }); | ||
@@ -18,3 +18,3 @@ const dataset = opts?.dataset || process.env.AXIOM_DATASET; | ||
const createCompletion = openai.createCompletion; | ||
openai.createCompletion = async (request: CreateCompletionRequest, options?: AxiosRequestConfig) => { | ||
openai.createCompletion = async (request: CreateCompletionRequest, options?: AxiosRequestConfig<any>) => { | ||
const start = new Date(); | ||
@@ -104,2 +104,1 @@ | ||
} | ||
{ | ||
"name": "axiom-ai", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "The official package to send events from AI libraries to Axiom.", | ||
"scripts": { | ||
"build": "tsc", | ||
"prepare": "npm run build", | ||
"test": "echo \"Error: no test specified\" && exit 0" | ||
@@ -37,3 +38,9 @@ }, | ||
"@axiomhq/axiom-node": "^0.11.0" | ||
}, | ||
"exports": { | ||
"./openai": { | ||
"require": "./dist/openai.js", | ||
"import": "./dist/openai.js" | ||
} | ||
} | ||
} | ||
} |
@@ -1,3 +0,6 @@ | ||
![axiom-ai: The official package to send events from AI libraries to Axiom](.github/images/banner-dark.svg#gh-dark-mode-only) | ||
![axiom-ai: The official package to send events from AI libraries to Axiom](.github/images/banner-light.svg#gh-light-mode-only) | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/163243/229035544-e4f5a8b2-eb65-4ef0-a17f-393072dc84c5.svg"> | ||
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/163243/229035583-e97a467c-6f80-4826-8424-2337bd0f66b7.svg"> | ||
<img alt="axiom-ai: The official package to send events from AI libraries to Axiom" src="https://user-images.githubusercontent.com/163243/229035583-e97a467c-6f80-4826-8424-2337bd0f66b7.svg"> | ||
</picture> | ||
@@ -27,3 +30,3 @@ [Axiom](https://axiom.co) unlocks observability at any scale. | ||
import { Configuration, OpenAIApi } from "openai"; | ||
import withAxiom from "axiom-ai/openai"; | ||
import { withAxiom } from "axiom-ai/openai"; | ||
@@ -30,0 +33,0 @@ (async function() { |
@@ -30,3 +30,3 @@ { | ||
// "rootDir": "./", /* Specify the root folder within your source files. */ | ||
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ | ||
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ | ||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ | ||
@@ -53,3 +53,3 @@ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ | ||
/* Emit */ | ||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ | ||
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ | ||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */ | ||
@@ -112,5 +112,9 @@ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ | ||
}, | ||
"lib": ["es2015", "es2016"], | ||
"include": [ | ||
"openai.ts" | ||
] | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
], | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
252684
14
913
84
1