Commit Graph

12 Commits

Author SHA1 Message Date
Matt Low 46149e0b67 Attempt to fix anthropic tool calling
Models have been way too eager to use tools when the task does not
require it (for example, reading the filesystem in order to show an
code example)
2024-03-17 22:55:02 +00:00
Matt Low 5e880d3b31 Lead anthropic function call XML with newline 2024-03-17 22:55:02 +00:00
Matt Low 62f07dd240 Fix double reply callback on tool calls 2024-03-17 22:55:02 +00:00
Matt Low ec1f326c2a Add store.AddReply 2024-03-14 06:01:42 +00:00
Matt Low db116660a5 Removed tool usage logging to stdout 2024-03-14 06:01:42 +00:00
Matt Low 32eab7aa35 Update anthropic function/tool calling
Strip the function call XML from the returned/saved content, which
should allow for model switching between openai/anthropic (and
others?) within the same conversation involving tool calls.

This involves reconstructing the function call XML when sending requests
to anthropic
2024-03-12 20:54:02 +00:00
Matt Low 91d3c9c2e1 Update ChatCompletionClient
Instead of CreateChatCompletion* accepting a pointer to a slice of reply
messages, it accepts a callback which is called with each successive
reply the conversation.

This gives the caller more flexibility in how it handles replies (e.g.
it can react to them immediately now, instead of waiting for the entire
call to finish)
2024-03-12 20:39:34 +00:00
Matt Low 8bdb155bf7 Update ChatCompletionClient to accept context.Context 2024-03-12 18:24:46 +00:00
Matt Low 2c7bdd8ebf Store enabled tools in lmcli.Context 2024-03-12 08:01:53 +00:00
Matt Low 7d56726c78 Add --model flag completion 2024-03-12 07:43:57 +00:00
Matt Low f2c7d2bdd0 Store ChromaHighlighter in lmcli.Context and use it
In preparation for TUI
2024-03-12 07:43:40 +00:00
Matt Low 0a27b9a8d3 Project refactor, add anthropic API support
- Split pkg/cli/cmd.go into new pkg/cmd package
- Split pkg/cli/functions.go into pkg/lmcli/tools package
- Refactor pkg/cli/openai.go to pkg/lmcli/provider/openai

Other changes:

- Made models configurable
- Slight config reorganization
2024-03-12 01:01:19 -06:00