This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{self, ...}: { | |
pinPackage = { | |
commit, | |
package, | |
hash ? self.pkgs.lib.fakeHash, | |
}: | |
(import (builtins.fetchTarball { | |
url = "https://github.com/NixOS/nixpkgs/archive/${commit}.tar.gz"; | |
sha256 = hash; | |
}) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opts.strategies.chat.tools = { | |
["fast_apply"] = { | |
callback = "strategies.chat.tools.catalog.fast_apply", | |
description = "Apply code changes to a file using morphllm for fast code modifications", | |
opts = { | |
adapter = "openai_compatible", | |
model = "morph-v3-large", | |
url = "https://api.morphllm.com/v1", | |
api_key = "cmd:cat /some/secret/file, | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local log = require("codecompanion.utils.log") | |
local utils = require("codecompanion.utils.adapters") | |
---Remove any keys from the message that are not allowed by the API | |
---@param message table The message to filter | |
---@return table The filtered message | |
local function filter_out_messages(message) | |
local allowed = { | |
"content", | |
"role", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local xml2lua = require("codecompanion.utils.xml.xml2lua") | |
local log = require("codecompanion.utils.log") | |
local function get_secret() | |
local cmd = os.getenv("HOME") .. "/scripts/get_secret.sh" | |
local handle = io.popen(cmd, "r") | |
if handle then | |
local result = handle:read("*a") | |
log:trace("Executed cmd: %s", cmd) | |
handle:close() |