nhaouari / obsidian-textgenerator-plugin

Text Generator is a versatile plugin for Obsidian that allows you to generate text content using various AI providers, including OpenAI, Anthropic, Google and local models.
https://text-gen.com/
MIT License
1.51k stars 135 forks source link

Summarize or use existing text #229

Open bmikaili opened 11 months ago

bmikaili commented 11 months ago

Hey, I fail to understand how to use this with existing text in a note. I have some text like this:

Commodo veniam cupidatat exercitation in cupidatat. Cupidatat cupidatat consequat elit amet ullamco non ipsum ex tempor mollit excepteur aute laboris sunt. Ullamco ut id aute nulla veniam labore ex eu est quis sit pariatur. Aliqua commodo consequat ex pariatur nisi laborum magna reprehenderit voluptate nulla ut. Reprehenderit aliquip enim labore sint consectetur ea. Nostrud cupidatat id adipisicing cillum velit ad enim ex non nisi sint enim non eu. Eu enim amet ullamco sunt et eiusmod. Laboris aliqua labore cupidatat deserunt exercitation cupidatat amet qui labore sunt.

Cillum sint cillum in eu non commodo ullamco pariatur. Ut non excepteur minim laboris cillum sint enim nulla nulla dolor do consequat amet nisi aute. Do magna reprehenderit labore do Lorem occaecat proident ex ipsum irure mollit. Ullamco nulla sit aute amet eiusmod et adipisicing minim dolore ad.

Exercitation aliquip nostrud in consequat magna officia id exercitation officia ullamco. Consectetur pariatur tempor aliquip. Sunt minim fugiat labore sunt esse do consequat pariatur ullamco minim ad velit incididunt Lorem. Labore sit adipisicing ut deserunt enim sit nulla in cillum ut minim. Magna nulla aute id ad id minim consequat anim. Deserunt fugiat nostrud sunt laborum sint cupidatat. Tempor anim do do adipisicing eu ad dolore irure pariatur consectetur.

And then when my cursor is here, I want to generate text and use above as context. But it does not recognize the text as context. Templates don't work either. What am I doing wrong? I looked at the docs but found nothing about context.

haouarihk commented 10 months ago

i don't understand your issue

bmikaili commented 10 months ago

Let us say below is my document:

This is a test document. It has some content that I already wrote.

And then, I want to generate text using this plugin, and use the existing content of the document to generate/inform the text generation, how do I do that?

Am I supposed to write a custom template for this?

haouarihk commented 10 months ago

It should work

jhmonroe commented 1 month ago

Seconding this @haouarihk ! Had a hard time getting it to recognize context or content. I tried both:

analyze the {{content}} of the current note for style and tone analyze the {{context}} of the current note for style and tone

And received:

[!ai]+ AI

I apologize, but I don't have access to the content of any specific note or document. Without the actual text of the email you're referring to, I can't analyze its style and tone. If you'd like me to analyze an email's style and tone, you would need to provide the content of that email. Once you do that, I can examine aspects like:

  1. Formality level
  2. Friendliness or professionalism
  3. Directness or indirectness
  4. Use of jargon or technical language
  5. Emotional tone (positive, neutral, negative)
  6. Length and complexity of sentences
  7. Use of active or passive voice
  8. Any notable rhetorical devices Please provide the content of the email if you'd like me to perform this analysis.

==

My template settings > {{context}} Variable Template also include the {{content}}:

Title: {{title}}

Starred Blocks: {{starredBlocks}}

Content: {{content}}

{{tg_selection}}

==

Realized after reading https://github.com/nhaouari/obsidian-textgenerator-plugin/discussions/137 that all i had to do was NOT select the instruction analyze the {{context}} of the current note for style and tone when generating and instead enter down one line and have a blank line for the cursor then click generate and it works.

this critical piece of info about an empty line should be more obvious in the docs about generate text since it's not mentioned anywhere i could find: https://docs.text-gen.com/_notes/2-+Options/Commands/Generate+Text