console-chat-gpt开源程序是用于 AI Chat API 的 Python CLI

​一、软件介绍

文末提供程序和源码下载

console-chat-gpt开源程序是用于 AI Chat API 的 Python CLI,与 AI 模型聊天的终极 CLI 伴侣,直接从命令行享受与 OpenAI、MistralAI、Anthropic、xAI、Google AI、DeepSeek、阿里巴巴、Inception 或 Ollama 托管模型的无缝交互。高效、轻松地提升您的聊天体验。

二、Features 特征

🆕 OpenAI Responses API supported. 🆕

🆕 支持 OpenAI 响应 API。🆕

🆕 Run any OpenAI SDK compatible model - just add the model structure with the relevant model_name and base_url to the config.toml file. 🆕

🆕 运行任何与 OpenAI SDK 兼容的模型 - 只需将模型结构与相关的 model_name and base_url 添加到 config.toml 文件中即可。🆕

⭐ Run Ollama hosted models locally. Ollama should be installed and the selected models to be already downloaded ⭐

⭐ 在本地运行 Ollama 托管模型。应该安装 Ollama 并下载⭐所选模型

⭐ Anthropic Prompt caching Fully supported ⭐

⭐ 完全支持 ⭐ Anthropic Prompt 缓存

⭐ Model Context Protocol (MCP) supported! If you are already using MCP servers just copy your claude_desktop_config.json to the root directory and rename to mcp_config.json to start using with any model! ⭐

⭐ 支持模型上下文协议 (MCP)!如果您已经在使用 MCP 服务器,只需将 your claude_desktop_config.json 复制到根目录并重命名为 mcp_config.json 即可开始使用任何模型!⭐

Unified chat completion function separated as independent library to be used in any application for seamless cross-provider API experience. The source code is available in Python and TypeScript

统一聊天完成功能分离为独立库,可用于任何应用程序,以实现无缝的跨提供商 API 体验。源代码以 Python 和 TypeScript 格式提供

Streaming with all supported models, disabled by default, may be enabled in settings menu

可以在 settings 菜单中启用所有受支持型号的流式传输(默认处于禁用状态)

OpenAI Assistants Beta fully supported

完全支持 OpenAI 助手 Beta 版

AI Managed mode Based on the complexity of the task, automatically determines which model to use.

AI 托管模式根据任务的复杂程度,自动确定要使用的模型。

Configuration File: Easily customize the app's settings through the config.toml file for complete control over how the app works. Also supported in-app via the settings command.

配置文件: 通过 config.toml 文件轻松自定义应用程序的设置,以完全控制应用程序的工作方式。也支持通过 settings 命令在应用程序内使用。

Role selection: Users can define the role of the AI in the conversation, allowing for a more personalized and interactive experience.

角色选择:用户可以定义 AI 在对话中的角色,从而获得更加个性化和交互式的体验。

Temperature Control: Adjust the temperature of generated responses to control creativity and randomness in the conversation.

温度控制:调整生成的响应的温度,以控制对话中的创造力和随机性。

Command Handling: The app responds to various commands entered by the user for easy and intuitive interaction.

命令处理: 该应用程序响应用户输入的各种命令,以实现轻松直观的交互。

Image input: with selected models.

图像输入:使用选定的模型。

Error Handling: Clear and helpful error messages to easily understand and resolve any issues.

错误处理:清晰有用的错误消息,可轻松理解和解决任何问题。

Conversation History: Review previous interactions and save conversations for future reference, providing context and continuity.

对话历史:查看以前的交互并保存对话以供将来参考,从而提供上下文和连续性。

Graceful Exit: Smoothly handle interruptions, ensuring conversations are saved before exiting to avoid loss of progress.

优雅退出:顺利处理中断,确保在退出前保存对话,以免丢失进度。

A nice team: Actively adding features, open for ideas and fixing bugs.

一个不错的团队:积极添加功能,乐于提出想法并修复错误。

Overall, this app focuses on providing a user-friendly and customizable experience with features that enhance personalization, control, and convenience.

总体而言,此应用程序专注于提供用户友好和可定制的体验,具有增强个性化、控制和便利性的功能。

三、Installation and Usage 安装和使用

The script works fine on Linux and MacOS terminals. For Windows it's recommended to use WSL.

该脚本在 Linux 和 MacOS 终端上运行良好。对于 Windows,建议使用 WSL。

Clone the repository: 克隆存储库:

git clone https://github.com/amidabuddha/console-chat-gpt.git

Go inside the folder:

进入文件夹:

cd console-chat-gpt

Install the necessary dependencies:

安装必要的依赖项:

python3 -m pip install -r requirements.txt

Get your API key from OpenAI, MistralAI, Anthropic, xAI, Google AI Studio, DeeepSeek, Alibaba, Inception depending on your selected LLM.

根据您选择的LLM,从 OpenAI、MistralAI、Anthropic、xAI、Google AI Studio、DeeepSeek、阿里巴巴、Inception 获取您的 API 密钥。

The config.toml.sample will be automatically copied into config.toml upon first run, with a prompt to enter your API key/s. Feel free to change any of the other defaults that are not available in the settings in-app menu as per your needs.

首次运行时,系统会自动复制 config.toml API config.toml.sample ,并提示输入 API 密钥。请根据您的需要随意更改应用程序 settings 内菜单中不可用的任何其他默认值。

Run the executable: 运行可执行文件:

python3 main.py

Pro-tip: Create an alias for the executable to run from anywhere.

专业提示:为可执行文件创建别名,以便从任何位置运行。

Use the help command within the chat to check the available options.

使用聊天中的 help 命令检查可用选项。

Enjoy 享受

四、Examples 例子

Prompt example: 提示示例:

Markdown 可视化示例:

Settings and help: 设置和帮助:

五、软件下载

夸克网盘分享

本文信息来源于GitHub作者地址:https://github.com/amidabuddha/console-chat-gpt

相关推荐
confiself7 分钟前
AndroidWorld+mobileRL
人工智能·深度学习
aneasystone本尊15 分钟前
学习 Chat2Graph 的任务分解与执行
人工智能
兴科Sinco16 分钟前
[leetcode 1]给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出和为目标值 target 的那两个整数[力扣]
python·算法·leetcode
嘀咕博客17 分钟前
10Web-AI网站生成器
人工智能·ai工具
宇钶宇夕19 分钟前
S7-200 SMART 实战:自动包装控制系统的指令应用拆解
运维·自动化
西柚小萌新22 分钟前
【从零开始的大模型原理与实践教程】--第一章:NLP基础概念
人工智能·自然语言处理
程序员奈斯26 分钟前
Python深度学习:NumPy数组库
python·深度学习·numpy
yongche_shi28 分钟前
第二篇:Python“装包”与“拆包”的艺术:可迭代对象、迭代器、生成器
开发语言·python·面试·面试宝典·生成器·拆包·装包
嘀咕博客28 分钟前
SafeEar:浙大和清华联合推出的AI音频伪造检测框架,错误率低至2.02%
人工智能·音视频·ai工具
深度学习lover28 分钟前
<数据集>yolo梨幼果识别数据集<目标检测>
python·yolo·目标检测·计算机视觉·数据集