Commit Graph

12 Commits

Author SHA1 Message Date
b229c42811 Add initial support for tools
So far only supported on the non-streaming endpoint.

Added the `read_dir` tool for reading contents from paths relative to the
current working directory.
2023-11-26 02:34:19 +00:00
2f3d95356a Be explicit with openai response choices limit (n parameter) 2023-11-25 13:39:52 -07:00
c02b21ca37 Refactor the last refactor :)
Removed HandlePartialResponse, add LLMRequest which handles all common
logic of making LLM requests and returning/showing their response.
2023-11-24 15:17:24 +00:00
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
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
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
168e0cf5d3 Parameterize maxTokens
Minor formatting/commet changes
2023-11-05 18:45:12 +00:00
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
794ccc52ff Show waiting animation while waiting for LLM response 2023-11-05 06:50:28 +00:00
200ec57f29 Run gofmt/goimports on go sources 2023-11-04 22:56:31 +00:00
5c6ec5e4e2 Include system prompt in OpenAI chat completion requests 2023-11-04 22:29:53 +00:00
16454a0bbd Project restructure
Moved source files into cmd/ and pkg/ directories
2023-11-04 13:35:23 -06:00