bramses / chatgpt-md

A (nearly) seamless integration of ChatGPT into Obsidian.
MIT License
824 stars 61 forks source link

Using gpt-4 as default not possible #89

Open archvalmiki opened 1 year ago

archvalmiki commented 1 year ago

Way to reproduce this issue:

Use the following front matter in both an Obsidian note and also in the Default Chat frontmatter settings box. For this, I restarted Obsidian after creating the note with the front matter (reloading the note seems to be necessary for in-file frontmatter changes to take effect, and I restarted Obsidian just in case the plugin requires a reload).

---
system_commands: [‘Be a helpful assistant with active language and concise responses. Refrain from summarizing, disclaimers, and apologizing. Minimize word count in explanations. On a 1-10 scale, where 1 is curt and 10 is verbose, aim for a 3.’]
temperature: 1
top_p: 1
max_tokens: 5000
presence_penalty: 0
frequency_penalty: 0
stream: true
stop: null
n: 1
model: 'gpt-4'
---

The system command ensures you get a very concise response back. Much more concise than gpt-3.5 behavior. Here's what I get with front matter in the file itself:

Flourishing involves thriving, high mental well-being, and engagement in life. Languishing is a lack of engagement, low motivation, and emotional stagnation.

Now create a second note without custom in-file front matter and ask the same question. This is when the default frontmatter should kick in. However, it looks like it does not. I got the following response. Notice how this seems like your bread-and-butter 3.5 turbo response. Verbose and meandering:

Flourishing and languishing are two opposite ends of the spectrum when it comes to mental health and well-being. 

Flourishing refers to a state of optimal functioning and well-being, where individuals experience positive emotions, engage in meaningful activities, and have a sense of purpose and fulfillment in life. Flourishing individuals have a positive outlook on life, are resilient in the face of challenges, and have strong social connections.

On the other hand, languishing refers to a state of stagnation and emptiness, where individuals experience a lack of motivation, engagement, and purpose in life. Languishing individuals may feel bored, apathetic, and disconnected from others. They may also experience negative emotions such as sadness, anxiety, and stress.

In summary, flourishing is characterized by positive emotions, engagement, and a sense of purpose, while languishing is characterized by a lack of motivation, engagement, and purpose, and negative emotions. 

This makes me believe that the default front-matter stuff is not working properly. And given that there is no easy way to verify what parameters are being used (see issue #88 ), it's hard to truly troubleshoot.

DeceptiveScorpion commented 1 year ago

@jazzwall2 I've been troubleshooting my own issues with the plugin.

Have you checked the console to see what the payload is using for the model? (See my example below). The shortcut to open console is ctrl+shift+i

image

archvalmiki commented 1 year ago

@jazzwall2 I've been troubleshooting my own issues with the plugin.

Have you checked the console to see what the payload is using for the model? (See my example below). The shortcut to open console is ctrl+shift+i

@DeceptiveScorpion thanks for the pointer. I just checked. The console shows that the plugin is using gpt-3.5-turbo by default even if the settings specify gpt-4. The only way to use gpt-4 is to provide it explicitly in the front-matter.

StephenHnilica commented 11 months ago

Try switching out your curly quotes for standard quotes. That might help.

I found that if I use "I'm" as opposed to "I am" in my prompt, it resorts to the default that's embedded in the code.

Kisaragi-ng commented 9 months ago

can confirm this only work in front matter, not in default

---
system_commands: [‘Be a helpful assistant with active language and concise responses. Refrain from summarizing, disclaimers, and apologizing. Minimize word count in explanations. On a 1-10 scale, where 1 is curt and 10 is verbose, aim for a 3.’]
temperature: 1
top_p: 1
max_tokens: 4096
presence_penalty: 0
frequency_penalty: 0
stream: true
stop: null
n: 1
model: 'gpt-4'
---