← 返回
沟通协作 Key 中文

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 cr...
基于PyQt5的GUI聊天窗口,用于LLM对话,支持流式响应与停止功能。在使用pywayne.llm.chat_window模块创建时调用。
wangyendt
沟通协作 clawhub v0.1.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 803
下载
💾 17
安装
1
版本
#latest

概述

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.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 09:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

imap-smtp-email

gzlicanyi
使用IMAP/SMTP读取和发送邮件;检查新/未读邮件、获取内容、搜索邮箱、标记已读/未读、发送带附件的邮件。支持...
★ 113 📥 52,405
productivity

Pywayne Statistics

wangyendt
综合性统计检验库,包含37种以上方法,涵盖正态性检验、位置检验、相关性检验、时间序列检验和模型诊断。
★ 0 📥 1,859
communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,585