Skip to content
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

Support Org style workflow where properties can be specified in org file level or org header level #99

Merged
merged 3 commits into from
Jan 3, 2024

Conversation

doctorguile
Copy link
Contributor

Hi,

Not sure if everyone has a die hard habit carried over from using org file in general where properties can be specified in org file level or org header level.

So SYS prompt, temperature etc can be set in file level or header level (see updated readme for example)

I find this makes org-ai fit perfectly into general org buffer workflow.

doctorguile and others added 3 commits November 28, 2023 23:22
README.md:
- Updated the documentation to clarify the behavior of ai blocks in ChatGPT.
- Added an example of using org file scope properties or a property drawer to inherit settings for ai blocks.

org-ai-openai.el:
- Refactored the `org-ai-stream-request` function to use a macrolet to capture arguments from different sources.
- Added support for inheriting properties from org headings.

org-ai.el:
- Added support for inheriting the system prompt and sys-everywhere property from org headings.
- Updated the `org-ai--collect-chat-messages` function to use the default system prompt if no prompt is specified.
@rksm rksm merged commit d892677 into rksm:master Jan 3, 2024
@rksm
Copy link
Owner

rksm commented Jan 3, 2024

That is great, thank you!

(callback (if messages
(lambda (result) (org-ai--insert-chat-completion-response context buffer result))
(lambda (result) (org-ai--insert-stream-completion-response context buffer result)))))
(cl-macrolet ((let-with-captured-arg-or-header-or-inherited-property
Copy link
Owner

@rksm rksm Jan 3, 2024

Choose a reason for hiding this comment

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

Sweeet lisp power.

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.

None yet

2 participants