Commit Graph

7 Commits

Author SHA1 Message Date
Paul Harrison 8c17d4165a Store conversation history on session end
At the end of each sesssion the conversation is stored to a directory
(defaulting to `.history` in the currrent working directory) as a JSON
object. Note, the session must be ended by sending the quit message (/q)
for the conversation to be saved. Ctrl+C will not work.
2023-08-24 18:22:15 +01:00
Paul Harrison 1670383fee Display running cost in USD after each response 2023-08-24 15:23:32 +01:00
Paul Harrison 2cd623e960 Optionally provide context files to chat session
This commit enables the user to provide one or more text files as
context for their chat session. These will be provided as system
messages to OpenAI's API, one message per file.
2023-08-23 09:35:33 +01:00
Paul Harrison 7cbde55aac Implement basic command line interface
Implements a basic CLI using Typer, Rich, and Prompt Toolkit. I couldn't
work out how to propoerly mock/fake the Rich console or the prompt
session from Prompt Toolkit, so I created dummy functions to work around
them and just test the basic application flow rather than user inputs
and outputs to the terminal.
2023-08-22 10:02:02 +01:00
Paul Harrison 0015ae4bff Add linting checks and code formatting
Linting checks are performed using Ruff, Mypy, and Pydocstyle. Code
formatting is performed using Black and Isort. A Makefile is also added
with linting and formatting commands for convenience.
2023-08-16 10:10:06 +01:00
Paul Harrison c9f01c7dc2 Basic interface to OpenAI's chat completion API
This commit implements a basic interface to hold a conversation with
OpenAI's GPT models via their API, using OpenAI's Python SDK. In
addition to this interface, the commit incorporates Pydantic for
managing settings via environment variables.
2023-08-14 12:49:38 +01:00
Paul Harrison dd9a8c96aa Initial commit 2023-08-13 19:53:05 +01:00