-
Notifications
You must be signed in to change notification settings - Fork 82
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
[Docs]: Chain of thought prompting usability isn't documented #1412
Comments
I am able to get some basic CoT by adding it as an attribute to the output class Adding CoT property to Output object
Response:
Prompt Fiddle : https://www.promptfiddle.com/BAML-Examples-RsZnY This might not be an elegant solution by glueing it to the output object , but the fact that just adding a new property with the description with no changes to the 'prompt' section highlights the ability to extract reasoning in a structured manner |
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Improves documentation for chain-of-thought prompting with examples and reusable snippets for various techniques. > > - **Documentation Enhancements**: > - Expanded `chain-of-thought.mdx` to include detailed explanations and examples of four techniques for chain-of-thought prompting. > - Added visual aid with an image and reference to Wei et al. (2022). > - Included `Tip` and `Info` sections to guide users on technique selection and BAML's capabilities. > - **Code Examples**: > - Provided `baml` code snippets for each technique, demonstrating how to implement chain-of-thought prompting in functions like `GetOrderInfo`. > - Introduced `template_string` for reusable chain-of-thought snippets. > - **Techniques Covered**: > - Technique 1: Reasoning before outputting structured object. > - Technique 2: Flexible reasoning before outputting structured object. > - Technique 3: Embedding reasoning in the structured object. > - Technique 4: Embedding reasoning as comments in the structured object. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 0a5932e. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
This is great, thanks a ton! |
The existing chain of thought prompting method in the docs isn't very concise or readable from a prompt perspective - the user has to type out this long and drawn out string as part of the BAML function.
Instead, it would be simpler to extract out the CoT prompt into a
template_string
and call that from inside the main function.Something like this based on my chat on Discord (maybe there's a better way to write it than the example shown?)
Having some form of abstracted way to do this that separates out the CoT concerns from the rest of the prompt would be nice, and should be documented to help users do CoT prompting more elegantly.
The text was updated successfully, but these errors were encountered: