Pywayne Llm Chat Window

👤 wangyendt 📦 v0.1.0 ⭐ 4.2 ⬇️ 1.1K 下載
💻 開發程式設計 免費 🔑 需 API Key

📖 技能介紹


name: pywayne-llm-chat-window description: PyQt5-based GUI chat window for LLM conversations with streaming responses and stop functionality. Use when working with pywayne.llm.chat_window module to create desktop chat applications with customizable window configuration, system message management, and real-time streaming display.


Pywayne Chat Window

This module provides a PyQt5-based desktop GUI chat window for LLM conversations.

Quick Start

from pywayne.llm.chat_window import ChatWindow

# Basic usage - quick launch
ChatWindow.launch(
    base_url="https://api.deepseek.com/v1",
    api_key="your_api_key",
    model="deepseek-chat"
)

Configuration

Using ChatConfig dataclass for full customization:

from pywayne.llm.chat_window import ChatWindow, ChatConfig

config = ChatConfig(
    base_url="https://api.deepseek.com/v1",
    api_key="your_api_key",
    model="deepseek-chat",
    temperature=0.8,
    window_title="AI Assistant",
    window_width=800,
    window_height=600
)

chat = ChatWindow(config)
chat.run()

ChatConfig Parameters

Parameter Default Description
base_url required API base URL
api_key required API key
model "deepseek-chat" Model name
temperature 0.7 Temperature (0-2)
max_tokens 2048 Max output tokens
top_p 1.0 Nucleus sampling
frequency_penalty 0.0 Frequency penalty (-2 to 2)
presence_penalty 0.0 Presence penalty (-2 to 2)
system_prompt "你是一個嚴謹的助手" System prompt
window_title "AI Chat" Window title
window_width 600 Window width
window_height 800 Window height
window_x 300 Window X position
window_y 300 Window Y position

System Messages

Set custom system prompts:

# Replace all system messages
chat.set_system_messages([
    {"role": "system", "content": "You are a Python expert"},
    {"role": "system", "content": "Provide code examples"}
])

# Add single system message
chat.add_system_message("You are now a creative writer")

Quick Launch with System Messages

ChatWindow.launch(
    base_url="https://api.deepseek.com/v1",
    api_key="your_api_key",
    model="deepseek-coder",
    system_messages=[
        {"role": "system", "content": "You are a Python expert"},
        {"role": "system", "content": "Keep answers concise with code"}
    ],
    window_title="Python Assistant"
)

Features

  • Streaming responses: Real-time token-by-token display
  • Stop generation: Button toggles between "傳送" (Send) and "停止" (Stop)
  • Message history: Maintains conversation context
  • Enter to send: Press Enter in input field to send message
  • System messages: Support for multiple system prompts

Requirements

  • PyQt5 - GUI framework
  • openai - OpenAI-compatible API client

API Reference

ChatWindow

7w4.net小蔥技能站,你的AI助手技能庫。

Method Description
__init__(config) Initialize with ChatConfig
set_system_messages(messages) Replace all system messages
add_system_message(content) Add single system message
run() Show window and start event loop
launch(base_url, api_key, ...) Class method to quickly launch chat window

ChatConfig

Dataclass for window and LLM configuration. All parameters optional except base_url and api_key.

🤖 AI 評測

這個 Skill 文件寫得清晰明白,功能說明和使用示例都很詳細,看起來是一個功能完整的桌面聊天工具。主要問題是它只提供了使用說明,卻沒有實際的程式碼檔案,所以使用者拿到手後可能無法直接使用,需要等待後續版本補充程式碼。對於想快速體驗桌面 AI 對話功能的使用者來說,目前版本的價值有限。

📊 多維度評分

適應性4.2
規範性4.2
有效性4.3
可靠性3.5
可信度4.8

📁 包含檔案 (2 個)

📄 SKILL.md 3.4 KB
📄 _meta.json 130 B