-
Notifications
You must be signed in to change notification settings - Fork 809
BREAKING CHANGE: rename result
-> output
#1248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6ce085f
to
8195738
Compare
result
-> output
result
-> output
PR Change SummaryRenamed instances of 'result' to 'output' across multiple files to improve clarity and consistency in the API documentation.
Modified Files
How can I customize these reviews?Check out the Hyperlint AI Reviewer docs for more information on how to customize the review. If you just want to ignore it on this PR, you can add the Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add What is Hyperlint?Hyperlint is an AI agent that helps you write, edit, and maintain your documentation. Learn more about the Hyperlint AI reviewer and the checks that we can run on your documentation. |
Docs Preview
|
|
||
@dataclass | ||
class AgentStream(Generic[AgentDepsT, ResultDataT]): | ||
class ToolStructuredOutput(Generic[OutputDataT]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmontagu please look at this and check if you're happy, it needs more tests and docs, but I think the principle should be clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this name, partially because it's kind of wordy, partially because I want a name for a function that you call and use its result as the final output, and I feel like whatever that thing gets called will be difficult to distinguish from this name. In particular, I wanted to use OutputTool
for that, but it seems confusing for OutputTool
and ToolStructuredOutput
to be different things.
I'll try to think of a better name for this ASAP..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I feel like we could just use OutputTool
as long as it's compatible with the "structured output" version (basically instantiating a type and using that as the output) and the (python) function calling version (using the value returned by the function as the output). It makes sense, considering that for many/most types you'd use with ToolStructuredOutput
, it's basically doing a function call with the model's response, just to the type's initializer instead of an arbitrary callable.
So I'd propose we rename this to OutputTool
, and plan to (eventually) support instantiating it with arbitrary callables (not just types)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the renaming, and tweaked the init signature to be a bit more future-proof (in particular, I've made it keyword-only). I'd be happy to change that in the future, just don't want that to break things when we add support for callables if getting type-checking to work requires some tweaks.
I made the keyword argument's keyword type_
, but I'm open to changing it to type
or tp
or whatever you think makes sense. (output_type
seems unfortunate given it's already an OutputTool
but could do that too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only concern is that OutputTool
feels like a kind of tool not a kind of structured output. It's not obvious what we would call "output using JSON Schema prompt" as an alternative to OutputTool
? OutputJSONSchema
feels confusing.
Could we call it OutputWithTool
, then in future add OutputWithJSONSchema
?
See instructor Mode
for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it a kind of tool though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thinking about it more, I'd be fine with OutputContent
or OutputJson
for the case you are describing.
I'd also be okay with ToolOutput
and PromptSchemaOutput
and StructuredOutput
, or some similar slew of names for the different modes.
But I'd rather not include With
in the name if at all possible, that just seems unnecessarily verbose.
I have a weak preference for the name starting with Output
instead of ending for discoverability, but it's not the end of the world; if it ends with Output
though we should maybe put them all in a dedicated module to help with discoverability in that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also be okay just having a single Output
type with different __init__
signatures for the different modes. I see pros and cons to that though; I'm still fine having separate types for the separate modes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I renamed OutputTool to ToolOutput and I think that's good enough for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 90 out of 90 changed files in this pull request and generated no comments.
No description provided.