Skip to content

trulens.core.schema.select

trulens.core.schema.select

Serializable selector-related classes.

Classes

Select

Utilities for creating selectors using Lens and aliases/shortcuts.

Attributes
Query class-attribute instance-attribute
Query = Lens

Selector type.

Tru class-attribute instance-attribute
Tru: Lens = Query()

Selector for the tru wrapper (TruLlama, TruChain, etc.).

Record class-attribute instance-attribute
Record: Query = __record__

Selector for the record.

App class-attribute instance-attribute
App: Query = __app__

Selector for the app.

RecordInput class-attribute instance-attribute
RecordInput: Query = main_input

Selector for the main app input.

RecordOutput class-attribute instance-attribute
RecordOutput: Query = main_output

Selector for the main app output.

RecordCalls class-attribute instance-attribute
RecordCalls: Query = app

Selector for the calls made by the wrapped app.

Laid out by path into components.

RecordCall class-attribute instance-attribute
RecordCall: Query = calls[-1]

Selector for the first called method (last to return).

RecordArgs class-attribute instance-attribute
RecordArgs: Query = args

Selector for the whole set of inputs/arguments to the first called / last method call.

RecordRets class-attribute instance-attribute
RecordRets: Query = rets

Selector for the whole output of the first called / last returned method call.

Functions
path_and_method staticmethod
path_and_method(select: Query) -> Tuple[Query, str]

If select names in method as the last attribute, extract the method name and the selector without the final method name.

dequalify staticmethod
dequalify(select: Query) -> Query

If the given selector qualifies record or app, remove that qualification.

render_for_dashboard staticmethod
render_for_dashboard(query: Query) -> str

Render the given query for use in dashboard to help user specify feedback functions.