Commit Graph

9 Commits

Author SHA1 Message Date
Matt Low 6249fbc8f8 Refactor streamed response handling
Update CreateChangeCompletionStream to return the entire response upon
stream completion. Renamed HandleDelayedResponse to
HandleDelayedContent, which no longer returns the content.

Removes the need wrapping HandleDelayedContent in an immediately invoked
function and the passing of the completed response over a channel. Also
allows us to better handle the case of partial a response.
2023-11-24 03:45:43 +00:00
Matt Low 8780856854 Set config defaults using a "default" struct tag
Add new SetStructDefaults function to handle the "defaults" struct tag.

Only works on struct fields which are pointers (in order to be able to
distinguish between not set (nil) and zero values). So, the Config
struct has been updated to use pointer fields and we now need to
dereference those pointers to use them.
2023-11-19 04:37:14 +00:00
Matt Low ae424530f9 Parameterize the openai model used
Add `openai.defaultConfig` to set the default, will allow overriding
with CLI flag
2023-11-09 06:07:52 +00:00
Matt Low 168e0cf5d3 Parameterize maxTokens
Minor formatting/commet changes
2023-11-05 18:45:12 +00:00
Matt Low 2c64ab501b Treat the system message like any other
Removed the system parameter on ChatCopmletion functions, and persist it
in conversations as well.
2023-11-05 07:55:07 +00:00
Matt Low 794ccc52ff Show waiting animation while waiting for LLM response 2023-11-05 06:50:28 +00:00
Matt Low 200ec57f29 Run gofmt/goimports on go sources 2023-11-04 22:56:31 +00:00
Matt Low 5c6ec5e4e2 Include system prompt in OpenAI chat completion requests 2023-11-04 22:29:53 +00:00
Matt Low 16454a0bbd Project restructure
Moved source files into cmd/ and pkg/ directories
2023-11-04 13:35:23 -06:00