flexeval.classes.turn#
Classes
|
Holds a single turn In a conversational exchange, each 'Turn' holds information from 1 or more outputs from the same source or role in sequence |
- class flexeval.classes.turn.Turn(**kwargs)[source]#
Bases:
BaseModelHolds a single turn In a conversational exchange, each ‘Turn’ holds information from 1 or more outputs from the same source or role in sequence
- dataset = <ForeignKeyField: Turn.dataset>#
- format_input_for_rubric(include_system_prompt: bool = False, include_tool_messages: bool = False)[source]#
This is the ‘public’ method that returns the info for this Turn
- get_content(include_toolcalls=True, include_tool_messages=True)[source]#
Content is a list of dictionaries where each dictionary contains the role and content of messages and tool calls in the turn. Each tool call appears after the message it’s associated with. If toolcalls are not desired, pass False to include_toolcalls.
- get_context(include_system_prompt=False) list[dict[str, str]][source]#
Context is the context of the first message in the turn
- id = <IntegerField: Turn.id>#
- index_in_thread = <IntegerField: Turn.index_in_thread>#
- messages#
!! processed by numpydoc !!
- metrics_list#
!! processed by numpydoc !!
- role = <TextField: Turn.role>#
- thread = <ForeignKeyField: Turn.thread>#
- toolcalls#
!! processed by numpydoc !!