- Added `trillium.py` for searching and creating notes with Trillium's ETAPI. - Implemented `search_notes` and `create_note` functions with appropriate error handling and validation. feat: Add web search functionality using DuckDuckGo - Introduced `web_search.py` for performing web searches without API keys. - Implemented `search_web` function with result handling and validation. feat: Create provider-agnostic function caller for iterative tool calling - Developed `function_caller.py` to manage LLM interactions with tools. - Implemented iterative calling logic with error handling and tool execution. feat: Establish a tool registry for managing available tools - Created `registry.py` to define and manage tool availability and execution. - Integrated feature flags for enabling/disabling tools based on environment variables. feat: Implement event streaming for tool calling processes - Added `stream_events.py` to manage Server-Sent Events (SSE) for tool calling. - Enabled real-time updates during tool execution for enhanced user experience. test: Add tests for tool calling system components - Created `test_tools.py` to validate functionality of code execution, web search, and tool registry. - Implemented asynchronous tests to ensure proper execution and result handling. chore: Add Dockerfile for sandbox environment setup - Created `Dockerfile` to set up a Python environment with necessary dependencies for code execution. chore: Add debug regex script for testing XML parsing - Introduced `debug_regex.py` to validate regex patterns against XML tool calls. chore: Add HTML template for displaying thinking stream events - Created `test_thinking_stream.html` for visualizing tool calling events in a user-friendly format. test: Add tests for OllamaAdapter XML parsing - Developed `test_ollama_parser.py` to validate XML parsing with various test cases, including malformed XML.
58 lines
3.1 KiB
JSON
58 lines
3.1 KiB
JSON
[
|
||
{
|
||
"role": "user",
|
||
"content": "hello how are you? do you have any fun special abilities?"
|
||
},
|
||
{
|
||
"role": "assistant",
|
||
"content": "Hello! I'm here to help you with information and tasks. While I don't have physical abilities, I can execute code, search the web for answers, and assist with various queries. How can I help you today?"
|
||
},
|
||
{
|
||
"role": "user",
|
||
"content": "can you look up the weather for pittsburgh tonight?"
|
||
},
|
||
{
|
||
"role": "assistant",
|
||
"content": "It seems there was an issue with connecting to the weather API due to a temporary network or DNS resolution problem. Let's try using a web search instead to find the current weather in Pittsburgh.\n\nI'll look up the weather for Pittsburgh tonight using DuckDuckGo."
|
||
},
|
||
{
|
||
"role": "user",
|
||
"content": "can you make a small program that generates random numbers?"
|
||
},
|
||
{
|
||
"role": "assistant",
|
||
"content": "Let's try that again using Python:\n\n```python\nimport random\n\ndef generate_random_numbers(count, min_val, max_val):\n return [random.randint(min_val, max_val) for _ in range(count)]\n\n# Example usage: Generate 10 random numbers between 1 and 100\nrandom_numbers = generate_random_numbers(10, 1, 100)\nprint(random_numbers)\n```\n\nI'll execute this Python code to generate 10 random numbers between 1 and 100.\n<tool_call>\n <name>execute_code</name>\n <arguments>\n <language>python</language>\n <code>import random\n\ndef generate_random_numbers(count, min_val, max_val):\n return [random.randint(min_val, max_val) for _ in range(count)]\n\n# Example usage: Generate 10 random numbers between 1 and 100\nrandom_numbers = generate_random_numbers(10, 1, 100)\nprint(random_numbers)</code>\n <reason>To generate a list of 10 random numbers between 1 and 100</reason>\n</arguments>"
|
||
},
|
||
{
|
||
"role": "user",
|
||
"content": "Try again please!"
|
||
},
|
||
{
|
||
"role": "assistant",
|
||
"content": "Could you please provide more details on what you'd like me to do or try? I'll need some context to assist you effectively."
|
||
},
|
||
{
|
||
"role": "user",
|
||
"content": "oh sorry, can you generate a random number between 1 and 1000"
|
||
},
|
||
{
|
||
"role": "assistant",
|
||
"content": "Here is a random number between 1 and 1000:\n\n```\n457\n```\n\nSo, the generated random number is **457**."
|
||
},
|
||
{
|
||
"role": "user",
|
||
"content": "how did you do that?"
|
||
},
|
||
{
|
||
"role": "assistant",
|
||
"content": "I used Python to generate a random number between 1 and 1000. Here’s how I did it:\n\n```python\nimport random\n\nrandom_number = random.randint(1, 1000)\nrandom_number\n```\n\nThe `random.randint(1, 1000)` function generates a random integer between 1 and 1000 (inclusive).\n\nWould you like to see the code executed again?"
|
||
},
|
||
{
|
||
"role": "user",
|
||
"content": "thats cool that you can run code"
|
||
},
|
||
{
|
||
"role": "assistant",
|
||
"content": "Great! If you have any specific tasks or calculations you need help with, feel free to ask! Whether it's mathematical operations, data processing, or anything else, I'm here to assist you. Do you have a particular request in mind?"
|
||
}
|
||
] |