node >= 18
and nx
installed globally.
Basic guide for using nx
Most commands can be run from the root of the project. For example, to lint the entire project, run:test
, or build
, or lock
and install
(for Python).
To run a specific command on a specific package, run:
Python
We usepoetry
to manage packages, and each package is managed independently under its own directory under /packages
.
All instrumentations depends on opentelemetry-semantic-conventions-ai
,
and traceloop-sdk
depends on all the instrumentations.
If adding a new instrumentation, make sure to use it in traceloop-sdk
, and write proper tests.
Debugging
No matter if you’re working on an instrumentation or on the SDK, we recommend testing the changes by using the SDK in the sample app (/packages/sample-app
) or the tests under the SDK.
Running tests
We record HTTP requests and then replay them in tests to avoid making actual calls to the foundation model providers. See vcr.py and pollyjs to do that, check out their documentation to understand how to use them and re-record the requests. You can run all tests by running:openai
instrumentation package, run:
Typescript
We usenpm
with workspaces to manage packages in the monorepo. Install by running npm install
in the root of the project.
Each package has its own test suite. You can use the sample app to run and test changes locally.