Disable import of langtrace (#185029)

## Summary

Disables the import for langtrace. When imported, it immediately
instruments openai lang client. This causes an issue where the
completion.create return is no longer a native ReadableStream and we
cannot tee off for pompt token counting
([here](https://github.com/elastic/kibana/blob/main/x-pack/plugins/stack_connectors/server/connector_types/openai/openai.ts#L309))

Under @dgieselaar request, i've commented out the import for now.
This commit is contained in:
Joe McElroy 2024-06-07 18:54:08 +01:00 committed by GitHub
parent c7d682323a
commit 1ec9412e82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,19 +5,19 @@
* 2.0.
*/
import { init } from '@langtrase/typescript-sdk';
// import { init } from '@langtrase/typescript-sdk';
export function initLangtrace() {
const apiKey = process.env.LANGTRACE_API_KEY;
const apiHost = process.env.LANGTRACE_API_HOST;
if (apiKey && apiHost) {
init({
api_host: apiHost,
api_key: apiKey,
write_to_langtrace_cloud: true,
disable_instrumentations: {
only: [],
},
});
// init({
// api_host: apiHost,
// api_key: apiKey,
// write_to_langtrace_cloud: true,
// disable_instrumentations: {
// only: [],
// },
// });
}
}