feat: add non-streaming LLM API, tool registry, and web_search tool
Replace SSE streaming with non-streaming JSON for Anthropic API. Add llm_chat_tools() returning structured llm_response_t with text and tool_use blocks. Implement tool registry with dispatch-by-name and web_search tool via Brave Search API (direct + proxy support). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
24
main/tools/tool_web_search.h
Normal file
24
main/tools/tool_web_search.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* Initialize web search tool — loads API key from NVS.
|
||||
*/
|
||||
esp_err_t tool_web_search_init(void);
|
||||
|
||||
/**
|
||||
* Execute a web search.
|
||||
*
|
||||
* @param input_json JSON string with "query" field
|
||||
* @param output Output buffer for formatted search results
|
||||
* @param output_size Size of output buffer
|
||||
* @return ESP_OK on success
|
||||
*/
|
||||
esp_err_t tool_web_search_execute(const char *input_json, char *output, size_t output_size);
|
||||
|
||||
/**
|
||||
* Save Brave Search API key to NVS.
|
||||
*/
|
||||
esp_err_t tool_web_search_set_key(const char *api_key);
|
||||
Reference in New Issue
Block a user