Skip to main content

问题

机器翻译译自英文(docs.typesafe.ai)本页 314 段已全部译完

文档索引

在以下地址获取完整的文档索引:https://docs.typesafe.ai/llms.txt 使用此文件可以在进一步探索之前发现所有可用页面。

问题

提供状态,并使用对象或字典提出是/否、Choice 和 Score 问题。

状态

state 是你想要询问相关问题的文本或 JSON 对象。它不能为 None,但对象内部的值可以为 None。

问题对象

使用 Noul、Choice 和 Score 定义具有命名参数的问题。

typesafe_sdk.NoulCriteria 类

基类:TypedDict

肯定和否定结果的可选描述。

详见 noul 原语。

true

instance-attribute

true: JSONContent | None

作为文本、JSON 对象或数组的肯定结果描述;None 表示未描述。

false

instance-attribute

false: JSONContent | None

对否定答案结果的描述,可以是文本、JSON 对象或数组;None 表示未描述。

typesafe_sdk.Noul

pydantic-model

基类:_Question, wire.NoulQuestion

一个“是/否”问题,可以为任一结果提供可选的描述。

详见 noul 原语。

Note

显示 JSON 架构:

字段:

instructions

pydantic-field

instructions: JSONContent | None = None

要提出的问题,表达为文本、JSON 对象或数组;可选。

criteria

pydantic-field

criteria: NoulCriteria | None = None

肯定和否定结果的可选描述。

typesafe_sdk.Choice 类

pydantic-model

基类:_Question、wire.ChoiceQuestion

在命名选项之间进行选择的问题。

详见 choice 原语。

Note

显示 JSON 架构:

字段:

criteria

pydantic-field

criteria: Mapping[str, JSONContent | None]

映射到文本、对象或数组描述的标签,或者对于未描述的标签为 None。

instructions

pydantic-field

instructions: JSONContent | None = None

要提出的问题,表达为文本、JSON 对象或数组;可选。

typesafe_sdk.Score 类

pydantic-model

基类:_Question, wire.ScoreQuestion

一个使用有序量规分配分数的问题。

详见 score 原语。

Note

显示 JSON 架构:

字段:

criteria

pydantic-field

criteria: Sequence[JSONContent]

一个非空的有序列表,包含文本、对象或数组描述,从零开始每个分数对应一个。

instructions

pydantic-field

instructions: JSONContent | None = None

要提出的问题,表达为文本、JSON 对象或数组;可选。

typesafe_sdk.Question

module-attribute

Question: TypeAlias = (
    Noul | Choice | Score | QuestionModel
)

一个问题对象或问题字典。

typesafe_sdk.Questions 类

module-attribute

Questions: TypeAlias = Mapping[str, Question]

以用于标识各答案的名称为键的问题输入。

问题字典

问题字典包含一个 type 键:"noul"、"choice" 或 "score"。你可以在同一个请求中混合使用字典和问题对象。

typesafe_sdk.NoulModel

基类:TypedDict

带有 type="noul" 的是/否问题字典。

详见 noul 原语。

type

instance-attribute

type: Literal['noul']

instructions

instance-attribute

instructions: NotRequired[JSONContent | None]

要提出的问题,表达为文本、JSON 对象或数组;可选。

criteria

instance-attribute

criteria: NotRequired[NoulCriteria | None]

肯定和否定结果的可选描述。

typesafe_sdk.ChoiceModel

基类:TypedDict

一个包含 type="choice" 的 Choice 问题字典。

详见 choice 原语。

type

instance-attribute

type: Literal['choice']

instructions

instance-attribute

instructions: NotRequired[JSONContent | None]

要提出的问题,表达为文本、JSON 对象或数组;可选。

criteria

instance-attribute

criteria: Mapping[str, JSONContent | None]

映射到文本、对象或数组描述的标签,或者对于未描述的标签为 None。

typesafe_sdk.ScoreModel

基类:TypedDict

一个包含 type="score" 的 Score 问题字典。

详见 score 原语。

type

instance-attribute

type: Literal['score']

instructions

instance-attribute

instructions: NotRequired[JSONContent | None]

要提出的问题,表达为文本、JSON 对象或数组;可选。

criteria

instance-attribute

criteria: Sequence[JSONContent]

一个非空的有序列表,包含文本、对象或数组描述,从零开始每个分数对应一个。

typesafe_sdk.QuestionModel

module-attribute

QuestionModel: TypeAlias = (
    NoulModel | ChoiceModel | ScoreModel
)

一个由其 type 键标识的问题字典。