-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Prominent example on using JSON mode #2224
Comments
Hello @ekzhu, I came across this issue while navigating through GitHub and noticed there's an interest in seeing a prominent example of JSON mode in action, especially for GroupChat applications. Having some experience with OpenAI's API, I thought I might contribute a simple but illustrative example. Here's how you could structure a JSON payload to interact with an AI in a GroupChat setting: {
"model": "gpt-3.5-turbo",
"prompt": "You are an AI present in a professional group chat. Your role is to assist users by providing accurate technical support. Keep your responses concise and informative.",
"temperature": 0.7,
"max_tokens": 250,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop": ["\n"]
} This example showcases how you might instruct the AI to behave in a helpful and professional manner within a chat. The For those inquiring about the use of constrained encoding like Guidance, this could involve additional fields within the JSON to dictate the dos and don'ts explicitly for the AI, ensuring it stays within the bounds of the intended conversation topic. If there's a specific scenario or constraints you're curious about, or if the group could use a more detailed run-through of these examples, I'd be glad to expand on this. Feel free to point out any specific requirements, and I'll do my best to tailor the example accordingly. Hope this helps, and I'm here if you need any further clarification! |
I've written a fair bit about JSON mode. very happy to collaborate with JZ and/or whomever else for a notebook & blog post. JSON mode for solving order of operations issues: https://www.linkedin.com/pulse/solving-ai-reasoning-flaws-leah-bonser-w76uc JSON mode and FSM for smooth speaker transition: https://www.linkedin.com/pulse/pseudo-weights-bias-implementation-graph-sequence-multi-leah-bonser-xwe8c I'm also about to start on an article about Task Decomposition, that will make heavy use of JSON as well. Happy to turn that into an example for AG as well. |
i would be quite keen + will make the time if you maybe might consider working together on a |
Hey yeah that sounds good. I haven't looked into semantic kernel that much, but I've quickly looked over the planner function and, yeah 100% thats what I've done. I've been experimenting with hierarchical task decomp, so each planner agent is typically only going to break the task down into a handful of steps, but more specialised planner further down the branch with break it down further if that makes sense. |
Looking forward to it @Aretai-Leah |
Is your article already available? :-) |
hey, the first one with a simple JSON mode is just about ready. I can probably have the decomp one done in a few days. |
Ok. Really dumb question. I've got a draft notebook for JSON mode. How do share it here? Notebooks aren't allowed as attachments. |
Not dumb it's great . so if you make a branch with this notebook in the examples folder , you can link it once it's published, but the best would be to make a PR based on this issue , because it's slightly easier to access the file(s) |
Ah, I'm not a collaborator yet. Nevertheless, I've zipped up the notebook here if anyone wants to test. |
Thanks @Aretai-Leah looking forward to a PR for the notebook. |
Was just chatting to Tonic. We could jazz it up a bit. update the output so it conforms to a spec like csv then have a function save it as csv. But the point with this one was to be very simple, focusing on the interactions between JSON and the agent Description. |
We need a very prominent example of using JSON mode -- either by OpenAI API or using constrained encoding like Guidance. It is important for using GroupChat and many have asked for it:
The text was updated successfully, but these errors were encountered: