Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Mar 6, 2025
1 parent 731c01a commit 5cc222d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/reference/_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ website:
href: reference/inspect_ai.tool.qmd#toolparams
- text: ToolParam
href: reference/inspect_ai.tool.qmd#toolparam
- text: JSONType
href: reference/inspect_ai.tool.qmd#jsontype
- text: tool
href: reference/inspect_ai.tool.qmd#tool
- section: inspect_ai.scorer
Expand Down Expand Up @@ -189,6 +187,8 @@ website:
href: reference/inspect_ai.model.qmd#generateconfig
- text: GenerateConfigArgs
href: reference/inspect_ai.model.qmd#generateconfigargs
- text: ResponseSchema
href: reference/inspect_ai.model.qmd#responseschema
- text: ModelOutput
href: reference/inspect_ai.model.qmd#modeloutput
- text: ModelUsage
Expand Down Expand Up @@ -427,6 +427,12 @@ website:
href: reference/inspect_ai.util.qmd#sandboxconnection
- text: sandboxenv
href: reference/inspect_ai.util.qmd#sandboxenv
- text: JSONType
href: reference/inspect_ai.util.qmd#jsontype
- text: JSONSchema
href: reference/inspect_ai.util.qmd#jsonschema
- text: json_schema
href: reference/inspect_ai.util.qmd#json_schema
- section: Inspect CLI
href: reference/inspect_eval.qmd
contents:
Expand Down
2 changes: 2 additions & 0 deletions src/inspect_ai/model/_generate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@


class ResponseSchema(BaseModel):
"""Schema for model response when using Structured Output."""

name: str
"""The name of the response schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."""

Expand Down
12 changes: 12 additions & 0 deletions src/inspect_ai/util/_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ class JSONSchema(BaseModel):


def json_schema(t: Type[Any]) -> JSONSchema:
"""Provide a JSON Schema for the specified type.
Schemas can be automatically inferred for a wide variety of
Python class types including Pydantic BaseModel, dataclasses,
and typed dicts.
Args:
t: Python type
Returns:
JSON Schema for type.
"""
origin = get_origin(t)
args = get_args(t)

Expand Down

0 comments on commit 5cc222d

Please sign in to comment.