From 0e1e85d0716646bbe23014f30b3d92041001e8ba Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Thu, 2 Jan 2025 15:41:27 -0800 Subject: [PATCH] Update dogs --- docs/griptape-framework/drivers/prompt-drivers.md | 6 +++--- .../drivers/src/prompt_drivers_structured_output.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/griptape-framework/drivers/prompt-drivers.md b/docs/griptape-framework/drivers/prompt-drivers.md index 0e8b8b9b9..d4c11814c 100644 --- a/docs/griptape-framework/drivers/prompt-drivers.md +++ b/docs/griptape-framework/drivers/prompt-drivers.md @@ -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" diff --git a/docs/griptape-framework/drivers/src/prompt_drivers_structured_output.py b/docs/griptape-framework/drivers/src/prompt_drivers_structured_output.py index 918725210..cb7eb5ceb 100644 --- a/docs/griptape-framework/drivers/src/prompt_drivers_structured_output.py +++ b/docs/griptape-framework/drivers/src/prompt_drivers_structured_output.py @@ -11,7 +11,7 @@ PromptTask( prompt_driver=OpenAiChatPromptDriver( model="gpt-4o", - structured_output_strategy="native", + structured_output_strategy="native", # optional ), output_schema=schema.Schema( {