add: 添加ollama调用AI chat逻辑
This commit is contained in:
@@ -3,6 +3,7 @@ id: cn.tayxie.llmplus
|
||||
version: 1.0.0
|
||||
license: MIT
|
||||
modules:
|
||||
- maubot_platform
|
||||
- maubot_llmplus
|
||||
main_class: AiBotPlugin
|
||||
config: true
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
from datetime import datetime
|
||||
|
||||
from typing import Type, Deque, Dict, Generator
|
||||
from mautrix.client import Client
|
||||
from collections import deque, defaultdict
|
||||
from maubot.handlers import command, event
|
||||
from typing import Type
|
||||
from maubot.handlers import event
|
||||
from maubot import Plugin, MessageEvent
|
||||
from mautrix.errors import MNotFound, MatrixRequestError
|
||||
from mautrix.types import Format, TextMessageEventContent, EventType, RoomID, UserID, MessageType, RelationType, \
|
||||
EncryptedEvent, MediaMessageEventContent, ImageInfo, EncryptedFile
|
||||
from mautrix.types import Format, TextMessageEventContent, EventType, MessageType, RelationType
|
||||
from mautrix.util import markdown
|
||||
from mautrix.util.config import BaseProxyConfig, ConfigUpdateHelper
|
||||
|
||||
from maubot_llmplus.llm.local_paltform import Ollama, LmStudio
|
||||
from maubot_llmplus.llm.platforms import Platform
|
||||
from maubot_llmplus.llm.thrid_platform import OpenAi, Anthropic
|
||||
from maubot_platform.local_paltform import Ollama, LmStudio
|
||||
from maubot_platform import Platform
|
||||
from maubot_platform.thrid_platform import OpenAi, Anthropic
|
||||
|
||||
"""
|
||||
配置文件加载
|
||||
|
||||
0
maubot_platform/__init__.py
Normal file
0
maubot_platform/__init__.py
Normal file
@@ -1,15 +1,10 @@
|
||||
import json
|
||||
import platform
|
||||
from collections import deque
|
||||
from typing import List
|
||||
|
||||
from maubot import Plugin
|
||||
from mautrix.types import MessageEvent
|
||||
from mautrix.util.config import BaseProxyConfig
|
||||
|
||||
from maubot_llmplus import AiBotPlugin
|
||||
from maubot_llmplus.llm import platforms
|
||||
from maubot_llmplus.llm.platforms import Platform, ChatCompletion
|
||||
from maubot_platform import platforms
|
||||
from maubot_platform.platforms import Platform, ChatCompletion
|
||||
|
||||
|
||||
class Ollama(Platform):
|
||||
@@ -1,12 +1,7 @@
|
||||
from collections import deque
|
||||
from typing import List
|
||||
|
||||
from maubot import Plugin
|
||||
from mautrix.types import MessageEvent
|
||||
from mautrix.util.config import BaseProxyConfig
|
||||
|
||||
from maubot_llmplus import AiBotPlugin
|
||||
from maubot_llmplus.llm.platforms import Platform, ChatCompletion
|
||||
from maubot_platform.platforms import Platform, ChatCompletion
|
||||
|
||||
|
||||
class OpenAi(Platform):
|
||||
Reference in New Issue
Block a user