MuiseDestiny / zotero-gpt

GPT Meet Zotero.
GNU Affero General Public License v3.0
5.03k stars 200 forks source link

askpdf出错,无法使用 #256

Open Jasoncrazy-stu opened 11 months ago

Jasoncrazy-stu commented 11 months ago

这个问题是否已有issue

运行环境

当前配置信息

No response

问题详情

api什么配置的正确的,问普通的问题都能够回答,就是在askpdf中无法获取pdf的文章内容,尝试过右键重置以及升级版本,无法解决问题。 根据提供的上下文信息,Meet.Global.views.messages是一个空数组,而Meet.Zotero.getRelatedText(Meet.Global.input)是一个调用了Zotero库来获取与Meet.Global.input相关的文本的函数。然而,没有提供Meet.Global.input的具体值,所以无法确定具体讲了什么。在没有更多上下文信息的情况下,无法回答本文讲了什么[1]。如果您能提供更多关于Meet.Global.input的信息,我将非常乐意帮助您进一步分析和回答问题。

补充说明

No response

haohao769 commented 11 months ago

根据给出的上下文信息,代码中的Meet.Zotero.getRelatedText(Meet.Global.input)表明正在调用“Meet.Zotero”中的getRelatedText函数,并将Meet.Global.input作为参数传递给它。由于上下文中没有提供关于Meet.Zotero和getRelatedText函数的详细信息,我无法确定具体的功能和返回结果。 然而,根据常识,Zotero是一个数字化研究工具,用于收集、组织和生成参考文献。getRelatedText函数可能是用于获取与输入相关的文本信息。因此,调用该函数来获取与Meet.Global.input相关的文本信息可能是为了进一步分析和处理文本。 因此,无法明确回答“文章讲了什么”的问题,因为上下文中没有提供有关输入内容和函数返回结果的详细信息。如果提供更多关于Meet.Global.input、Meet.Zotero和getRelatedText函数的信息,我将能够给出更具体的回答。

haohao769 commented 11 months ago

这是什么情况

zfb132 commented 11 months ago

长按标签进入编辑模式,确保每个标签的内容如下
https://github.com/MuiseDestiny/zotero-gpt/blob/e80732367f6804f7c36a8403a1ff026403e6eeee/src/modules/base.ts#L85-L162

Jasoncrazy-stu commented 11 months ago

长按标签进入编辑模式,确保每个标签的内容如下

https://github.com/MuiseDestiny/zotero-gpt/blob/e80732367f6804f7c36a8403a1ff026403e6eeee/src/modules/base.ts#L85-L162 还是不行,回复这个了开始 I apologize, but it seems that there was a mistake in the context provided. The code snippet ${Meet.Zotero.getRelatedText(Meet.Global.input)}$ suggests that we are trying to retrieve related text based on the input given in ${Meet.Global.input}$. However, the specific value of ${Meet.Global.input}$ has not been provided, making it impossible for me to generate a comprehensive reply or provide citations based on the context information given. Additionally, the intended location for reply, ${Zotero.locate}$, is not clear. Could you please provide more specific information or clarify the query so that I can assist you better?

zfb132 commented 11 months ago

@Jasoncrazy-stu 长按标签进入编辑模式,把你的当前标签的内容粘贴上来。另外,你的版本是6.0.27 0.2.9吗

Jasoncrazy-stu commented 11 months ago

@Jasoncrazy-stu 长按标签进入编辑模式,把你的当前标签的内容粘贴上来。另外,你的版本是6.0.27 0.2.9吗

🪐AskPDF[position=10][color=#0EA293][trigger=/^(本文|这篇文章|论文)/]

You are a helpful assistant. Context information is below. ${ Meet.Global.views.messages = []; Meet.Zotero.getRelatedText(Meet.Global.input) } Using the provided context information, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided context information refer to multiple subjects with the same name, write separate answers for each subject. Use prior knowledge only if the given context didn't provide enough information.

Answer the question:${Meet.Global.input}

Reply in ${Zotero.locate} 就是复制你给的代码,zotero版本6.0.27 gpt版本0.2.9 尝试更新0.3.2提示版本不兼容

zfb132 commented 11 months ago

可能是版本的问题,你可以尝试改为以下内容

#🪐AskPDF[color=#0EA293][position=10][trigger=/^(本文|这篇文章|论文)/]
You are a helpful assistant. Context information is below.
<code>
Meet.Global.views.messages = [];
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>
Using the provided context information, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided context information refer to multiple subjects with the same name, write separate answers for each subject. Use prior knowledge only if the given context didn't provide enough information.

Answer the question: <code>Meet.Global.input</code>

Reply in ${Zotero.locale}

对于其他标签,参照同样的方法对下面的原始内容替换过去即可

  var defaultTags = [
    `
#\u{1FA90}AskPDF[color=#0EA293][position=10][trigger=/^(\u672C\u6587|\u8FD9\u7BC7\u6587\u7AE0|\u8BBA\u6587)/]
You are a helpful assistant. Context information is below.
<code>
Meet.Global.views.messages = [];
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>
Using the provided context information, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided context information refer to multiple subjects with the same name, write separate answers for each subject. Use prior knowledge only if the given context didn't provide enough information.

Answer the question: <code>Meet.Global.input</code>

Reply in ${Zotero.locale}
`,
    `
#\u{1F31F}Translate[c=#D14D72][pos=11][trigger=/^\u7FFB\u8BD1/]
Translate these content to \u7B80\u4F53\u4E2D\u6587:
<code>
Meet.Global.input.replace("\u7FFB\u8BD1", "") ||
Meet.Zotero.getPDFSelection() ||
Meet.Global.views.messages[0].content
</code>
`,
    `
#\u2728Improve writing[color=#8e44ad][pos=12][trigger=/^\u6DA6\u8272/]
Below is a paragraph from an academic paper. Polish the writing to meet the academic style, improve the spelling, grammar, clarity, concision and overall readability. When necessary, rewrite the whole sentence. Furthermore, list all modification and explain the reasons to do so in markdown table. Paragraph: "<code>
Meet.Global.input.replace("\u6DA6\u8272", "") ||
Meet.Global.views.messages[0].content
</code>"
`,
    `
#Clipboard[c=#576CBC][pos=13][trigger=/(\u526A\u8D34\u677F|\u590D\u5236\u5185\u5BB9)/]
This is the content in my clipboard:
<code>Meet.Zotero.getClipboardText()</code>
---
<code>Meet.Global.input</code>
`,
    `
#Annotations[c=#F49D1A][pos=14][trigger=/(\u9009\u4E2D|\u9009\u62E9\u7684|\u9009\u62E9|\u6240\u9009)?(\u6CE8\u91CA|\u9AD8\u4EAE|\u6807\u6CE8)/]
These are PDF Annotation contents:
<code>
Meet.Zotero.getPDFAnnotations(Meet.Global.input.match(/(\u9009\u4E2D|\u9009\u62E9\u7684|\u9009\u62E9|\u6240\u9009)/))
</code>

Please answer me in the language of my question. Make sure to cite results using [number] notation after the reference. 
My question is: <code>Meet.Global.input</code>
`,
    `
#Selection[c=#D14D72][pos=15][trigger=/^(\u8FD9\u6BB5|\u9009\u4E2D)(\u6587\u672C|\u8BDD|\u6587\u5B57|\u63CF\u8FF0)/]
Read these content:
<code>
Meet.Zotero.getPDFSelection() ||
Meet.Global.views.messages[0].content
</code>
---
Answer me in the language of my question. This is my question: <code>Meet.Global.input</code>
`,
    `
#Item[c=#159895][pos=16][trigger=/\u8FD9\u7BC7(\u6587\u732E|\u8BBA\u6587|\u6587\u7AE0)/]
This is a Zotero item presented in JSON format:
<code>
JSON.stringify(ZoteroPane.getSelectedItems()[0].toJSON())
</code>

Base on this JSON: <code>Meet.Global.input</code>
`,
    `
#Items[c=#159895][pos=17][trigger=/\u8FD9\u4E9B(\u6587\u732E|\u8BBA\u6587)/]
These are Zotero items presented in JSON format:
<code>
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>

Please answer me using the lanaguage as same as my question. Make sure to cite results using [number] notation after the reference. 
My question is: <code>Meet.Global.input</code>
`
  ];
Jasoncrazy-stu commented 11 months ago

可能是版本的问题,你可以尝试改为以下内容

#🪐AskPDF[color=#0EA293][position=10][trigger=/^(本文|这篇文章|论文)/]
You are a helpful assistant. Context information is below.
<code>
Meet.Global.views.messages = [];
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>
Using the provided context information, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided context information refer to multiple subjects with the same name, write separate answers for each subject. Use prior knowledge only if the given context didn't provide enough information.

Answer the question: <code>Meet.Global.input</code>

Reply in ${Zotero.locale}

对于其他标签,参照同样的方法对下面的原始内容替换过去即可

  var defaultTags = [
    `
#\u{1FA90}AskPDF[color=#0EA293][position=10][trigger=/^(\u672C\u6587|\u8FD9\u7BC7\u6587\u7AE0|\u8BBA\u6587)/]
You are a helpful assistant. Context information is below.
<code>
Meet.Global.views.messages = [];
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>
Using the provided context information, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided context information refer to multiple subjects with the same name, write separate answers for each subject. Use prior knowledge only if the given context didn't provide enough information.

Answer the question: <code>Meet.Global.input</code>

Reply in ${Zotero.locale}
`,
    `
#\u{1F31F}Translate[c=#D14D72][pos=11][trigger=/^\u7FFB\u8BD1/]
Translate these content to \u7B80\u4F53\u4E2D\u6587:
<code>
Meet.Global.input.replace("\u7FFB\u8BD1", "") ||
Meet.Zotero.getPDFSelection() ||
Meet.Global.views.messages[0].content
</code>
`,
    `
#\u2728Improve writing[color=#8e44ad][pos=12][trigger=/^\u6DA6\u8272/]
Below is a paragraph from an academic paper. Polish the writing to meet the academic style, improve the spelling, grammar, clarity, concision and overall readability. When necessary, rewrite the whole sentence. Furthermore, list all modification and explain the reasons to do so in markdown table. Paragraph: "<code>
Meet.Global.input.replace("\u6DA6\u8272", "") ||
Meet.Global.views.messages[0].content
</code>"
`,
    `
#Clipboard[c=#576CBC][pos=13][trigger=/(\u526A\u8D34\u677F|\u590D\u5236\u5185\u5BB9)/]
This is the content in my clipboard:
<code>Meet.Zotero.getClipboardText()</code>
---
<code>Meet.Global.input</code>
`,
    `
#Annotations[c=#F49D1A][pos=14][trigger=/(\u9009\u4E2D|\u9009\u62E9\u7684|\u9009\u62E9|\u6240\u9009)?(\u6CE8\u91CA|\u9AD8\u4EAE|\u6807\u6CE8)/]
These are PDF Annotation contents:
<code>
Meet.Zotero.getPDFAnnotations(Meet.Global.input.match(/(\u9009\u4E2D|\u9009\u62E9\u7684|\u9009\u62E9|\u6240\u9009)/))
</code>

Please answer me in the language of my question. Make sure to cite results using [number] notation after the reference. 
My question is: <code>Meet.Global.input</code>
`,
    `
#Selection[c=#D14D72][pos=15][trigger=/^(\u8FD9\u6BB5|\u9009\u4E2D)(\u6587\u672C|\u8BDD|\u6587\u5B57|\u63CF\u8FF0)/]
Read these content:
<code>
Meet.Zotero.getPDFSelection() ||
Meet.Global.views.messages[0].content
</code>
---
Answer me in the language of my question. This is my question: <code>Meet.Global.input</code>
`,
    `
#Item[c=#159895][pos=16][trigger=/\u8FD9\u7BC7(\u6587\u732E|\u8BBA\u6587|\u6587\u7AE0)/]
This is a Zotero item presented in JSON format:
<code>
JSON.stringify(ZoteroPane.getSelectedItems()[0].toJSON())
</code>

Base on this JSON: <code>Meet.Global.input</code>
`,
    `
#Items[c=#159895][pos=17][trigger=/\u8FD9\u4E9B(\u6587\u732E|\u8BBA\u6587)/]
These are Zotero items presented in JSON format:
<code>
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>

Please answer me using the lanaguage as same as my question. Make sure to cite results using [number] notation after the reference. 
My question is: <code>Meet.Global.input</code>
`
  ];

全部修改为的格式,依旧无法使用,我觉得可能是这函数的问题? I apologize, but the given context is not sufficient for me to provide a comprehensive reply to the query. The provided code snippet suggests that there is a global variable named “Meet.Global.views.messages” which is an empty array. Additionally, there is a function call to “Meet.Zotero.getRelatedText” with an argument of “Meet.Global.input”. However, without information about what this function does or what the “Meet.Global.input” refers to, I cannot give a specific answer. If you can provide more information about the purpose and behavior of the “Meet.Zotero.getRelatedText” function and the “Meet.Global.input” variable, I would be more than happy to assist you further.

zfb132 commented 11 months ago

是的,Zotero没有正确地把<code>包裹的部分用实际变量的值替换出来。你可以把日志信息脱敏发我邮箱看看

Jasoncrazy-stu commented 11 months ago

是的,Zotero没有正确地把<code>包裹的部分用实际变量的值替换出来。你可以把日志信息脱敏发我邮箱看看 如何查看日志?

zfb132 commented 11 months ago

按照下面的提示保存日志

In the Help menu, go to Debug Output Logging and select Enable, or, to generate debug output from Zotero startup, select “Restart with Logging Enabled…”. (If you're not able to access the Help menu, see Reporting Startup Errors instead.) Immediately perform the relevant action (syncing, saving, importing, etc.) and reproduce the problem you're experiencing. Before doing anything else, return to Help → Debug Output Logging and click View Output, go to File → “Save…”, choose Format: “Text Files”, and save the output to a file. It can be helpful to ZIP the file before emailing it.

Jasoncrazy-stu commented 11 months ago

按照下面的提示保存日志

In the Help menu, go to Debug Output Logging and select Enable, or, to generate debug output from Zotero startup, select “Restart with Logging Enabled…”. (If you're not able to access the Help menu, see Reporting Startup Errors instead.) Immediately perform the relevant action (syncing, saving, importing, etc.) and reproduce the problem you're experiencing. Before doing anything else, return to Help → Debug Output Logging and click View Output, go to File → “Save…”, choose Format: “Text Files”, and save the output to a file. It can be helpful to ZIP the file before emailing it.

我尝试输出了一下debug,已经发送到你主页中标注的邮箱了

zfb132 commented 11 months ago

必须在zoterogpt的输入框中输入一些内容(也就是必须有提问的问题),再点击下方的标签(例如AskPDF)。若输入框为空(相当于你没问任何问题,它自然不知道要干什么),则不会解析命令语句。

例如你可以输入本文创新点解决的问题等等

Jasoncrazy-stu commented 11 months ago

必须在zoterogpt的输入框中输入一些内容(也就是必须有提问的问题),再点击下方的标签(例如AskPDF)。若输入框为空(相当于你没问任何问题,它自然不知道要干什么),则不会解析命令语句。

例如你可以输入本文创新点解决的问题等等

非常感谢,解决了问题。不过我记得我之前最开始使用的时候,直接点击askpdf就能生成一系列相关的回答,不知道是不是记忆出了问题,不过目前能够使用了,谢谢!

helixingchen commented 10 months ago

根据提供的上下文信息,我们可以看出您正在使用Meet.Zotero.getRelatedText函数来获取与创新点相关的文本信息。然而,请注意上下文信息中并没有给出与创新点相关的具体内容,因此我无法为您提供直接的答案。 如果您需要关于创新点的具体信息,我建议您提供更多的上下文信息,以便我可以给出更准确的答案。或者,您也可以尝试通过自行搜索创新点相关的内容来获取更多信息。 如果您有其他任何问题或需要帮助,请随时告诉我。

helixingchen commented 10 months ago

输入创新点,给我这样回复

shysl1 commented 10 months ago

长按标签进入编辑模式,确保每个标签的内容如下

https://github.com/MuiseDestiny/zotero-gpt/blob/e80732367f6804f7c36a8403a1ff026403e6eeee/src/modules/base.ts#L85-L162

请问这个修改之后怎么保存呢?我修改之后这个对话框里就一直是编辑模式。

我想用这部分替换掉我的 ${ Meet.Global.views.messages = []; Meet.Zotero.getRelatedText(Meet.Global.input) }

我的里面的这部分是这样的 ${ Meet.Zotero.getRelatedText(Meet.Global.input) }

shysl1 commented 10 months ago

可能是版本的问题,你可以尝试改为以下内容

#🪐AskPDF[color=#0EA293][position=10][trigger=/^(本文|这篇文章|论文)/]
You are a helpful assistant. Context information is below.
<code>
Meet.Global.views.messages = [];
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>
Using the provided context information, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided context information refer to multiple subjects with the same name, write separate answers for each subject. Use prior knowledge only if the given context didn't provide enough information.

Answer the question: <code>Meet.Global.input</code>

Reply in ${Zotero.locale}

对于其他标签,参照同样的方法对下面的原始内容替换过去即可

  var defaultTags = [
    `
#\u{1FA90}AskPDF[color=#0EA293][position=10][trigger=/^(\u672C\u6587|\u8FD9\u7BC7\u6587\u7AE0|\u8BBA\u6587)/]
You are a helpful assistant. Context information is below.
<code>
Meet.Global.views.messages = [];
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>
Using the provided context information, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided context information refer to multiple subjects with the same name, write separate answers for each subject. Use prior knowledge only if the given context didn't provide enough information.

Answer the question: <code>Meet.Global.input</code>

Reply in ${Zotero.locale}
`,
    `
#\u{1F31F}Translate[c=#D14D72][pos=11][trigger=/^\u7FFB\u8BD1/]
Translate these content to \u7B80\u4F53\u4E2D\u6587:
<code>
Meet.Global.input.replace("\u7FFB\u8BD1", "") ||
Meet.Zotero.getPDFSelection() ||
Meet.Global.views.messages[0].content
</code>
`,
    `
#\u2728Improve writing[color=#8e44ad][pos=12][trigger=/^\u6DA6\u8272/]
Below is a paragraph from an academic paper. Polish the writing to meet the academic style, improve the spelling, grammar, clarity, concision and overall readability. When necessary, rewrite the whole sentence. Furthermore, list all modification and explain the reasons to do so in markdown table. Paragraph: "<code>
Meet.Global.input.replace("\u6DA6\u8272", "") ||
Meet.Global.views.messages[0].content
</code>"
`,
    `
#Clipboard[c=#576CBC][pos=13][trigger=/(\u526A\u8D34\u677F|\u590D\u5236\u5185\u5BB9)/]
This is the content in my clipboard:
<code>Meet.Zotero.getClipboardText()</code>
---
<code>Meet.Global.input</code>
`,
    `
#Annotations[c=#F49D1A][pos=14][trigger=/(\u9009\u4E2D|\u9009\u62E9\u7684|\u9009\u62E9|\u6240\u9009)?(\u6CE8\u91CA|\u9AD8\u4EAE|\u6807\u6CE8)/]
These are PDF Annotation contents:
<code>
Meet.Zotero.getPDFAnnotations(Meet.Global.input.match(/(\u9009\u4E2D|\u9009\u62E9\u7684|\u9009\u62E9|\u6240\u9009)/))
</code>

Please answer me in the language of my question. Make sure to cite results using [number] notation after the reference. 
My question is: <code>Meet.Global.input</code>
`,
    `
#Selection[c=#D14D72][pos=15][trigger=/^(\u8FD9\u6BB5|\u9009\u4E2D)(\u6587\u672C|\u8BDD|\u6587\u5B57|\u63CF\u8FF0)/]
Read these content:
<code>
Meet.Zotero.getPDFSelection() ||
Meet.Global.views.messages[0].content
</code>
---
Answer me in the language of my question. This is my question: <code>Meet.Global.input</code>
`,
    `
#Item[c=#159895][pos=16][trigger=/\u8FD9\u7BC7(\u6587\u732E|\u8BBA\u6587|\u6587\u7AE0)/]
This is a Zotero item presented in JSON format:
<code>
JSON.stringify(ZoteroPane.getSelectedItems()[0].toJSON())
</code>

Base on this JSON: <code>Meet.Global.input</code>
`,
    `
#Items[c=#159895][pos=17][trigger=/\u8FD9\u4E9B(\u6587\u732E|\u8BBA\u6587)/]
These are Zotero items presented in JSON format:
<code>
Meet.Zotero.getRelatedText(Meet.Global.input)
</code>

Please answer me using the lanaguage as same as my question. Make sure to cite results using [number] notation after the reference. 
My question is: <code>Meet.Global.input</code>
`
  ];

我想问一下如何升级版本?我目前的版本显示是0.2.9 然后目前问关于文章的问题都说没有提供上下文啥的 我不是很懂代码 不太知道咋解决

zfb132 commented 10 months ago

长按标签进入编辑模式,确保每个标签的内容如下 https://github.com/MuiseDestiny/zotero-gpt/blob/e80732367f6804f7c36a8403a1ff026403e6eeee/src/modules/base.ts#L85-L162

请问这个修改之后怎么保存呢?我修改之后这个对话框里就一直是编辑模式。

我想用这部分替换掉我的 ${ Meet.Global.views.messages = []; Meet.Zotero.getRelatedText(Meet.Global.input) }

我的里面的这部分是这样的 ${ Meet.Zotero.getRelatedText(Meet.Global.input) }

修改之后,在编辑框Ctrl+S即可保存

zfb132 commented 10 months ago

我想问一下如何升级版本?我目前的版本显示是0.2.9

你如果使用的是Zotero 6, 0.2.9已经是最新版本了。只有使用Zotero 7 才可以使用0.3.2版本

问关于文章的问题都说没有提供上下文啥的 我不是很懂代码 不太知道咋解决

即使0.2.9也支持提供上下文提问。你需要:

  • 确保你是在PDF阅读页面调出的GPT窗口(提问过程中右下角会显示正在解析PDF文档内容)
  • 由于token数量的限制,确实存在你问的问题刚好未被检索到的可能
zfb132 commented 10 months ago

根据提供的上下文信息,我们可以看出您正在使用Meet.Zotero.getRelatedText函数来获取与创新点相关的文本信息。然而,请注意上下文信息中并没有给出与创新点相关的具体内容,因此我无法为您提供直接的答案。 如果您需要关于创新点的具体信息,我建议您提供更多的上下文信息,以便我可以给出更准确的答案。或者,您也可以尝试通过自行搜索创新点相关的内容来获取更多信息。 如果您有其他任何问题或需要帮助,请随时告诉我。

是否已经阅读上述解决方案?或者重新安装本插件

shysl1 commented 10 months ago

我想问一下如何升级版本?我目前的版本显示是0.2.9

你如果使用的是Zotero 6, 0.2.9已经是最新版本了。只有使用Zotero 7 才可以使用0.3.2版本

问关于文章的问题都说没有提供上下文啥的 我不是很懂代码 不太知道咋解决

即使0.2.9也支持提供上下文提问。你需要:

  • 确保你是在PDF阅读页面调出的GPT窗口(提问过程中右下角会显示正在解析PDF文档内容)
  • 由于token数量的限制,确实存在你问的问题刚好未被检索到的可能 解决了,非常感谢!
wangzhankun commented 9 months ago

我也碰到了类似的问题,我已经提供了问题,然后再按下的askpdf按钮,但是依然有问题:

抱歉,我需要更多的信息来回答您的问题。请提供论文的标题、主要论点和结论,这样我才能帮您总结论文。感谢您的理解。
image