-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Continuing conversation with context from AIChat output_schema #79
Comments
how abot you use AIChat without the output_schema as the input to the function call? |
I think the underlying goal here is to have one chat session that exclusively consists of natural language inputs and outputs in its history, but still be able produce structured input/output "under the hood" for any given message. As an example:
This is reminiscent of what gen_with_tools does, except rather than have the library manage the use of tools, I would like it to run a specific set of functions every time and return structured context outputs for each user message, then unstructured Assistant outputs using the structured context from the functions (like a "hook"). The approached used in Maybe something like this would suffice for now (non-functional code, just sketching it out):
|
In OpenAI's official docs on function calling, they give a pattern of:
With simpleaichat's
AIChat
class, I am doing something that looks like:output_schema
At this point, I would like to call the model again as in Step 4 above, except with the structured data from
AIChat
'soutput_schema
as context, in order to produce a natural language response.So:
Is the preferred/recommended way to do this to using the
AIChat
class? Ideally I could do this in the very same conversation/instance rather than create a new conversation/instance to handle context.In the OpenAI example, they do the following:
Is it recommended to (for example) send a message to the model using the
function
role, even if no such functions were defined? In this case, I'm effectively using theAIChat
instance itself withoutput_schema
as a function. I would just like to get a natural language response in addition to the structuredoutput_schema
response.The text was updated successfully, but these errors were encountered: