Skip to content

[Agents] Add structured output section#457

Draft
dannyjameswilliams wants to merge 2 commits into
mainfrom
agents/structured_output
Draft

[Agents] Add structured output section#457
dannyjameswilliams wants to merge 2 commits into
mainfrom
agents/structured_output

Conversation

@dannyjameswilliams

Copy link
Copy Markdown
Contributor

Not to be merged until agents has released this feature

What's being changed:

New section to the query agent docs for the soon supported structured outputs feature. Added link to relevant index + references in other pages.

Type of change:

  • Documentation content updates (non-breaking change to fix/update documentation )
  • Bug fix (non-breaking change to fixes an issue with the site)
  • Feature or enhancements (non-breaking change to add functionality)

How has this been tested?

  • Local build - the site works as expected when running yarn start

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@danmichaeljones danmichaeljones left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One minor point below but otherwise the only thing I notice is that the sidebar of the Structured Outputs page always lists both python+TS headers:

Image


Structured outputs are supported with [streaming ask mode](../guides/ask_mode.md#streaming).

When streaming, the structured output is delivered incrementally as raw string fragments through `StreamedTokens` instances. No special parsing is applied during the stream — each token is simply a piece of the final output. To use the result, accumulate the streamed tokens into a single string, then validate the completed string against your schema. You can also attempt partial validation as the string grows if you want to react to the output before the stream finishes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use the result, accumulate the streamed tokens into a single string, then validate the completed string against your schema.

If you're happy waiting until the stream has finished, you can just read the result from the final response (which has it fully parsed).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks yeah, this was an oversight. Added more detail now + changed the python/TS headers to just bold text so it doesn't appear on the side panel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants