Code Monkey home page Code Monkey logo

mockingparrot's Introduction

Crate License

MockingParrot

A TUI client for ChatGPT.

Preview

Getting started

Download a precompiled binary from the GitHub Releases page. Or, if you have the Rust toolchain then run:

cargo install mockingparrot

You will need to copy your API key into the config file.

Version upgrades may not be backward compatible: if you are upgrading to a newer version, you may need to remove your config file or other saved data.

mockingparrot's People

Contributors

arielhorwitz avatar friedlandaaron avatar

Watchers

 avatar  avatar  avatar

mockingparrot's Issues

Configuration UI

Configuration should be displayed more pretty and have a more friendly and intuitive way to modify.

The config toml file should be located in a user directory (e.g. ~/.config/hummingparrot/config.toml) and be updated when modified in the UI.

System instruction presets

Every conversation should start with a message by the "system" user role, which supposedly has a greater weight. The user should be able to write system instruction presets and select one for every conversation.

Separate calculating UI layout and widget rendering

mockingparrot/src/ui.rs

Lines 153 to 155 in f1b8123

let line_count = convo_text.line_count(convo_layout.width - 2);
let max_scroll = u16::try_from(line_count).unwrap_or(u16::MAX);
state.ui.conversation_scroll = state.ui.conversation_scroll.min(max_scroll);

This is how we fix overscrolling. It does so by clamping the scroll value based on how many lines the widget needs to be rendered. This was implemented like so because it was the most straightforward approach: seeing how many lines the widget needs as it is being rendered. However, this requires passing to the UI rendering function a mutable reference to the State object, which seems quite smelly.

This will likely continue being an issue as the UI requires more scrollbars and other complex UI widgets.

I suggest considering some sort of approach such as separating the UI rendering into 3 parts:

  1. Calculating the UI layout
  2. Fix overscrolling and any other layout-based adjustments
  3. Render the widgets into the layout from step 1

Image generation

There is API for Dall-E text-to-image models. This can be supported by the client (separately from the conversation).

Conversation in visual editor

Currently the user can type their message in the conversation UI. They should be able to edit their message in a visual editor.

Configurable hotkeys

Hotkeys are hardcoded and not documented anywhere. They should be configurable in config.toml.

Stats recording

Every API call to ChatGPT returns the token count. This should be recorded and tallied. This can also be used to calculate the cost.

One thing I haven't figured out yet is dynamically retrieving the cost via API call. Last I checked it was not available in the API, but ideally it should be retrieved as to avoid hardcoding it (especially since the cost per token can change).

Hotkey scopes

Each hotkey needs to have a UI scope in which it is active. E.g. the chat model configuration controls should only be active when the UI is focused on the config tab.

CI Workflow

The project could use a GitHub workflow to make sure new code passes linters and is formatted before merging to master.

Save and load history

The client should save conversations and allow loading conversations from history.

Furthermore, conversation history should be searchable. (this will be a separate issue)

Consistent styling

Currently, the style config looks like this:

[ui.colors]
conversation.background = "#020414"
conversation.foreground = "#33DD88"
conversation_names = "#DD4400"
prompt.background = "#110000"
prompt.foreground = "#DDCC04"
config.background = "#020414"
config.foreground = "#FF5511"
debug.background = "#020414"
debug.foreground = "#5511FF"

Which leads to either inconsistent styling or lots of repetition. I suggest consolidating on a more unified style with a single color for text fg/bg, and also adding colors for scroll bars, title bars, status bars, highlighting, etc.

Notify the user about using both `temperature` and `top_p`

Currently, the API call is being made with both, but the API reference recommends against this:

We generally recommend altering temperature or top_p but not both.

Not sure if this is an issue, and if so with what approach to fix this. The user may alter both if they like, but if the user alters one and the default is used for the other, this may not be an issue.

Hotkey parsing syntax

A more intuitive syntax in the configuration would be desirable.

E.g. Control + Shift + T or ^!t. Currently this is { code = "t", modifiers = "CONTROL | SHIFT" }.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.