Install the dependencies

For typescript, add a package.json as follows:

{
	"dependencies": {
		"@langtrase/typescript-sdk": "^3.3.2",
		"openai": "^4.50.0"
	}
}

Following are the parameters that you need to initialize the SDK:

Here we are using http://localhost:3000/api/trace as the API host. You can replace it with your own DNS or IP address.

Sample Code

Following is a ready-to-run code snippet that you can use to test the SDK with your local setup:

Make Sure to pip or npm install the required packages before running the code.

Run the scripts as follows

For Typescript to work, you will have to add the following line in package.json file. json "type": "module"