Skip to content

Commit

Permalink
Update dogs
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Jan 2, 2025
1 parent e5ca892 commit 0e1e85d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/griptape-framework/drivers/prompt-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ You can pass images to the Driver if the model supports it:

Some LLMs provide functionality often referred to as "Structured Output". This means instructing the LLM to output data in a particular format, usually JSON. This can be useful for forcing the LLM to output in a parsable format that can be used by downstream systems.

If an [output_schema](../../reference/griptape/tasks.md#griptape.tasks.PromptTask.output_schema) is provided to the Task, you can change _how_ the output is structured by setting the Driver's [structured_output_strategy](../../reference/griptape/drivers.md#griptape.drivers.BasePromptDriver.structured_output_strategy) to one of:
You can change _how_ the output is structured by setting the Driver's [structured_output_strategy](../../reference/griptape/drivers.md#griptape.drivers.BasePromptDriver.structured_output_strategy) to one of:

- `native`: The Driver will use the LLM's structured output functionality provided by the API.
- `tool`: Griptape will pass a special Tool, [StructuredOutputTool](../../reference/griptape/tools/structured_output_tool.md) and try to force the LLM to use a Tool.

Each Driver may have a different default setting depending on the LLM provider's capabilities.

### JSON Schema
### Prompt Task

The easiest way to get started with structured output is by using a [JsonSchemaRule](../structures/rulesets.md#json-schema). If a [schema.Schema](https://pypi.org/project/schema/) instance is provided to the Rule, Griptape will convert it to a JSON Schema and provide it to the LLM using the selected structured output strategy.
The easiest way to get started with structured output is by using a [PromptTask](../structures/tasks.md#prompt)'s [output_schema](../../reference/griptape/tasks.md#griptape.tasks.PromptTask.output_schema) parameter.

```python
--8<-- "docs/griptape-framework/drivers/src/prompt_drivers_structured_output.py"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PromptTask(
prompt_driver=OpenAiChatPromptDriver(
model="gpt-4o",
structured_output_strategy="native",
structured_output_strategy="native", # optional
),
output_schema=schema.Schema(
{
Expand Down

0 comments on commit 0e1e85d

Please sign in to comment.