mattermost / mattermost-plugin-ai

Mattermost Copilot plugin supporting multiple LLMs
https://mattermost.com/copilot
Apache License 2.0
136 stars 30 forks source link

Make `StreamingTimeoutSecond` configurable #179

Closed kaakaa closed 5 months ago

kaakaa commented 6 months ago

Refs #176

Description

Make StreamingTimeoutSecond configurable for OpenAI and OpenAI Compatible. With setting it to 60, I could fix the timeout issue with ollama refered in #176.

Screenshot from 2024-05-11 22-54-00

azigler commented 6 months ago

Thank you for this PR @kaakaa! Pinging @crspeller for review.

crspeller commented 6 months ago

@kaakaa Hey! Thanks for the contribution. Couple of changes to the system console went though. Do you mind fixing the conflicts? Let me know if you need any help.

kaakaa commented 6 months ago

@crspeller Thanks for letting me know it. I've updated the code with the new system console.

NOTE: When deploying master branch to test my changes, the AI chat was not working due to the following error.

{"timestamp":"2024-05-25 04:48:14.655 Z","level":"error","msg":"failed to get bot: ","caller":"app/plugin_api.go:1003","plugin_id":"mattermost-ai"}

The cause would be that Config.DefaultBotName is empty. Switching Default bot in sytem console would update Config.DefaultBotName, but I can't do it because I don't have Enterprise plan and can create only one bot. Updating and deleting existing bot didn't resolve this error. It seems that users who are not on the Enterprise Plan may encounter this issue.

By adding code before the following location to assign the default name ('ai') when defaultBotName is empty, I was able to temporarily work around the issue. However, this method requires changing the settings once, so it does not seem to be the best solution. https://github.com/mattermost/mattermost-plugin-ai/blob/39e09762b8788622783b22efabb3e48e81cde05b/webapp/src/components/system_console/config.tsx#L156-L160

crspeller commented 5 months ago

@kaakaa Thanks! I did noticed that issue while working on another pr and have a partial fix here: https://github.com/mattermost/mattermost-plugin-ai/pull/187/files#diff-efcd221be1d5948ef999c98624dc2d4a15dedc19b0945ca1b819a3d51480c607R142 But yes I need to fix the migration there.

tjdalsry commented 5 months ago

When will this issue be patched?