pywayne-llm-chat-window

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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pywayne-llm-chat-window" with this command: npx skills add wangyendt/chat-window

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

ParameterDefaultDescription
base_urlrequiredAPI base URL
api_keyrequiredAPI key
model"deepseek-chat"Model name
temperature0.7Temperature (0-2)
max_tokens2048Max output tokens
top_p1.0Nucleus sampling
frequency_penalty0.0Frequency penalty (-2 to 2)
presence_penalty0.0Presence penalty (-2 to 2)
system_prompt"你是一个严谨的助手"System prompt
window_title"AI Chat"Window title
window_width600Window width
window_height800Window height
window_x300Window X position
window_y300Window 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

MethodDescription
__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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Ai Competitor Analyzer

提供AI驱动的竞争对手分析,支持批量自动处理,提升企业和专业团队分析效率与专业度。

Registry SourceRecently Updated
General

Ai Data Visualization

提供自动化AI分析与多格式批量处理,显著提升数据可视化效率,节省成本,适用企业和个人用户。

Registry SourceRecently Updated
General

Ai Cost Optimizer

提供基于预算和任务需求的AI模型成本优化方案,计算节省并指导OpenClaw配置与模型切换策略。

Registry SourceRecently Updated