Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/examples/tutorials/more-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ We're going to use the [`LLMChat`][plugboard.library.LLMChat] to access OpenAI:

1. `LLMChat` can use [structured output](https://docs.llamaindex.ai/en/stable/understanding/extraction/structured_llms/) to process the LLM response into a known format. Here we define a Pydantic model that specifies everything we're expecting back.
2. Setting `expand_response = True` will unpack `location`, `latitude` and `longitude` into separate outputs on the component.
3. The LLM model is passed explicitly: LlamaIndex's default (`gpt-3.5-turbo`) has been [deprecated by OpenAI](https://platform.openai.com/docs/deprecations), so always specify a current model.

!!! info
To run this tutorial you'll need an API key for [OpenAI](https://platform.openai.com/docs/quickstart). Set the `OPENAI_API_KEY` environment variable to provide it to the model.
Expand Down
1 change: 1 addition & 0 deletions examples/tutorials/003_more_components/hello_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async def main() -> None:
system_prompt="Identify a geographical location from the input and provide its latitude and longitude",
response_model=Location,
expand_response=True, # (2)!
llm_kwargs={"model": "gpt-4o-mini"}, # (3)!
)
# --8<-- [end:llm]
# --8<-- [start:weather]
Expand Down
Loading