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 136 forks source link

same setting Mac work but PC dont work with LMstudio API #238

Closed victoryangn closed 10 months ago

victoryangn commented 10 months ago

setting as below : LLM Provider: OpenAi Chat API Key: None Base Path: I used LMSTUDIO, so that it is: http://localhost:1234/v1 Model: gpt-3.5-turbo

=== this setting work in my mac m2 pro, without any problem

=== same setting doesnt work on PC, the log as below:

[2024-01-09 08:48:06.957] [INFO] [LM STUDIO SERVER] Processing queued request... [2024-01-09 08:48:06.958] [INFO] Received OPTIONS request to /v1/chat/completions with body: {} [2024-01-09 08:48:06.958] [ERROR] 'messages' field is required [2024-01-09 08:48:08.173] [INFO] [LM STUDIO SERVER] Processing queued request... [2024-01-09 08:48:08.174] [INFO] Received OPTIONS request to /v1/chat/completions with body: {} [2024-01-09 08:48:08.174] [ERROR] 'messages' field is required [2024-01-09 08:48:11.121] [INFO] [LM STUDIO SERVER] Processing queued request... [2024-01-09 08:48:11.122] [INFO] Received OPTIONS request to /v1/chat/completions with body: {} [2024-01-09 08:48:11.122] [ERROR] 'messages' field is required [2024-01-09 08:48:16.539] [INFO] [LM STUDIO SERVER] Processing queued request... [2024-01-09 08:48:16.540] [INFO] Received OPTIONS request to /v1/chat/completions with body: {} [2024-01-09 08:48:16.541] [ERROR] 'messages' field is required

victoryangn commented 10 months ago

log in obsidian Failure Error: Connection error.

plugin:obsidian-textgenerator-plugin:14963 OpenAI.makeRequest plugin:obsidian-textgenerator-plugin:14963:17

plugin:obsidian-textgenerator-plugin:21611 async eval plugin:obsidian-textgenerator-plugin:21611:25

plugin:obsidian-textgenerator-plugin:1271 async RetryOperation.eval [as _fn] plugin:obsidian-textgenerator-plugin:1271:19

haouarihk commented 10 months ago

maybe try resetting your settings.. old config conflict?

victoryangn commented 10 months ago

maybe try resetting your settings.. old config conflict?

many thanks for your update, I have tried many times, even reinstall, seems not work, is there any one succeed on PC with local LLM

haouarihk commented 10 months ago

The tutorial post was using a windows pc

haouarihk commented 10 months ago

can you test with version 0.6.1

dennisvandalen commented 10 months ago

@victoryangn I had the same issue, turning on CORS in the server will fix it.

CleanShot 2024-01-13 at 16 25 06

victoryangn commented 10 months ago

@victoryangn I had the same issue, turning on CORS in the server will fix it.

CleanShot 2024-01-13 at 16 25 06

that's great, many thanks for the help ,it is work, perfect