Project Overview: ChatGPT
ChatGPT is a robust C# client that provides a graphical user interface for interacting with OpenAI's ChatGPT. This versatile application can be run on various operating systems, including MacOS, Windows, Linux, Android, iOS, and browsers. It leverages the power of the Avalonia UI framework, offering a consistent and modern interface across all platforms.
Getting Started
To utilize the ChatGPT application, users must obtain an OpenAI API key. This key can be set as the OPENAI_API_KEY
environment variable or input directly into the app settings, allowing seamless connectivity to OpenAI's services.
For those curious about exploring without installation, a web-based client version is available, enabling users to interact with the application via a web browser here.
Features and Shortcuts
ChatGPT includes various features and keyboard shortcuts to enhance productivity and user experience:
Main Window Shortcuts
- Ctrl+Shift+A: Switch between transparent and acrylic blur window styles.
- Ctrl+Shift+S: Toggle window visibility between visible and hidden.
Message Prompt Shortcuts
- Enter: Send the current prompt.
- Escape: Cancel prompt editing.
- F2: Edit the current prompt.
- Shift+Enter or Alt+Enter: Insert a new line within the prompt.
OpenAI API Configuration
For users needing to customize their server interaction, the API URL can be overridden by setting the OPENAI_API_URL_CHAT_COMPLETIONS
environment variable or via app settings.
Building the Application
To build the ChatGPT client, users must:
- Install .NET 7.0.
- Use the command
dotnet workload install ios android wasm-tools
. - Run
dotnet publish -c Release
within the project directory ordotnet run
for desktop platforms.
Dependencies
The application relies on several critical dependencies, including:
- Avalonia: Provides the UI framework.
- Markdown.Avalonia: Facilitates Markdown rendering.
- Avalonia.HtmlRenderer: Enables HTML rendering capabilities.
- CommunityToolkit.Mvvm: Supports MVVM architecture patterns.
NuGet Packages
ChatGPT offers comprehensive NuGet packages for a range of functionalities:
- ChatGPT: Core library for OpenAI API integration.
- ChatGPT.Core: Core libraries for client functionalities.
- ChatGPT.UI: User interface components.
- ChatGPT.CLI: Command-line interface tool for automated tasks.
Command-Line Tool
ChatGPT provides a .NET command-line interface (CLI) tool to perform various text processing and API tasks directly from the terminal. It offers flexible options for text transformation, code conversion, and documentation tasks.
Documentation and License
Detailed guides and API references are available in the OpenAI documentation here. ChatGPT is freely available under the MIT license, ensuring open access to its codebase for modification and distribution.
In summary, ChatGPT offers a versatile, cross-platform solution for interacting with the OpenAI model, catering to developers and users seeking a robust and customizable chat interface.