Looking for TypeScript? See the TypeScript guide.
typesafe-sdk). Calls to TypeSafeClient.system_one and AsyncTypeSafeClient.system_one are captured as OpenInference DECISION spans.
A System One request sends a state plus a map of typed questions (Noul, Choice, Score) and returns one typed answer per question. That makes System One a decision model rather than a language model. The span records the request state/model/questions as input.value and the response answers/usage as output.value, and identifies the model and its token usage under decision.* rather than llm.*.
Requires typesafe-sdk >= 0.6.0 and openinference-instrumentation-typesafe >= 0.1.4.
Install
Setup
Use theregister function to connect your application to Phoenix:
Run TypeSafe AI
A simple TypeSafe AI application that is now instrumented:AsyncTypeSafeClient is instrumented the same way, and questions can be passed as SDK objects (as above) or as raw dictionaries.
Observe
With instrumentation enabled, eachsystem_one call shows up in Phoenix as a DECISION span containing:
input.value: the request body (state,model,questions) as JSONllm.invocation_parameters: the call configuration, meaning themodeland anyextra_bodyfieldsoutput.value: the response body (model,answers,usage) as JSONdecision.systemanddecision.provider: bothtypesafedecision.request.model_name(for examplejev-latest),decision.response.model_name(the resolved model, for examplejev-1.13.0), anddecision.model_name(the response model when reported, else the requested one)decision.token_count.inputanddecision.token_count.output, from the response’susage
decision.* rather than llm.*, so decision-model calls stay out of Phoenix’s LLM token and cost reporting. Earlier releases recorded them under llm.*, and releases before 0.1.3 recorded them as LLM spans.

state and the answers are recorded only as input.value and output.value, not as llm.input_messages / llm.output_messages.
Configuration
Because thestate and the questions are recorded only in input.value, TraceConfig(hide_inputs=True) keeps the whole request off the span, and hide_outputs=True does the same for the answers. llm.invocation_parameters holds no request content, only the model and any extra_body fields; mask it with hide_llm_invocation_parameters if those are sensitive.
suppress_tracing(), and context attributes such as using_session, using_user, and using_attributes propagate session, user, metadata, and tag information onto the spans it produces.

