runner code refactor, frontend papercuts
Some checks failed
CI/CD Pipeline / build (push) Failing after 4s
Some checks failed
CI/CD Pipeline / build (push) Failing after 4s
This commit is contained in:
22
lib/elixir_ai/chat_runner/tool_config.ex
Normal file
22
lib/elixir_ai/chat_runner/tool_config.ex
Normal file
@@ -0,0 +1,22 @@
|
||||
defmodule ElixirAi.ChatRunner.ToolConfig do
|
||||
alias ElixirAi.{AiTools, Conversation}
|
||||
|
||||
def handle_call({:set_tool_choice, tool_choice}, _from, state) do
|
||||
Conversation.update_tool_choice(state.name, tool_choice)
|
||||
{:reply, :ok, %{state | tool_choice: tool_choice}}
|
||||
end
|
||||
|
||||
def handle_call({:set_allowed_tools, tool_names}, _from, state) do
|
||||
Conversation.update_allowed_tools(state.name, tool_names)
|
||||
server_tools = AiTools.build_server_tools(self(), tool_names)
|
||||
liveview_tools = AiTools.build_liveview_tools(self(), tool_names)
|
||||
|
||||
{:reply, :ok,
|
||||
%{
|
||||
state
|
||||
| allowed_tools: tool_names,
|
||||
server_tools: server_tools,
|
||||
liveview_tools: liveview_tools
|
||||
}}
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user