feat: Implement Trillium notes executor for searching and creating notes via ETAPI
- 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.
This commit is contained in:
66
core/relay/sessions/sess-eu3b01j3.json
Normal file
66
core/relay/sessions/sess-eu3b01j3.json
Normal file
@@ -0,0 +1,66 @@
|
||||
[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "can you use python to calculate 50/2?"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "The result of 50 divided by 2 is 25.0."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "can you generate random numbers with python? please run the script for me"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Here are five random numbers between 1 and 100: `[84, 82, 73, 37, 22]`."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "can you build a python script that does something cool? whatever you want. And run it so i can see it"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Here is the randomly generated password:\n\n```\nUc6hsO!v)kh:\n```\n\nYou can use this password for your needs. If you need another one, just let me know!"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "hey im testing things"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Hello! How can I assist you with your tests? Do you have a specific task or question in mind?"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "hmm for some reason your thinking stream insnt connecting. its odd"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Great! The code executed successfully and printed \"Hello, World!\". This suggests that the connection is working correctly.\n\nIs there anything specific you'd like to test or try next?"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "make some more cool scripts"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Great! The scripts are working correctly now.\n\n1. The first script generated a random number between 1 and 100, which was `91`.\n2. The second script plotted this number on a histogram.\n\nHere is the output from the first script:\n```\n91\n```\n\nAnd here is what should have been displayed in the plot (though I can't show the image directly):\n- A histogram with one bar at position 91, indicating that the random number generated was 91.\n\nWould you like to run these scripts again or try something else?"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "can you make a script that displays a ball bouncing around?"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "It seems there is a persistent issue with the execution environment. Let's simplify the approach and try running the script directly in this context.\n\nHere is the Python code for a bouncing ball animation:\n\n```python\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n# Create a figure and axis\nfig, ax = plt.subplots()\n\n# Set the limits for the axes so that the ball doesn't go out of bounds\nax.set_xlim(0, 8)\nax.set_ylim(0, 6)\n\n# Initial position of the ball\nball, = ax.plot([2], [3], 'ro') # 'ro' means a red circle\n\ndef init():\n ball.set_data([], [])\n return ball,\n\ndef animate(i):\n x = i % 8\n y = (i // 8) % 6\n ball.set_data(x, y)\n return ball,\n\n# Create the animation\nani = animation.FuncAnimation(fig, animate, init_func=init,\n frames=48, interval=50, blit=True)\n\nplt.show()\n```\n\nSince we are unable to execute it directly, let's describe the steps you can follow in your local environment:\n\n1. Install `matplotlib` if you haven't already:\n ```bash\n pip install matplotlib\n ```\n2. Copy and paste the above code into a Python script (e.g., `bouncing_ball.py`) and run it.\n\nThis should display an animation of a ball bouncing around within a 8x6 window in your local environment. If you need further assistance or have any other requests, feel free to ask!"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "im trying to fix your python environment. Can you make a script that just says hello world 5 times?"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "The script executed successfully and printed \"Hello, World!\" five times as expected:\n\n```\nHello, World!\nHello, World!\nHello, World!\nHello, World!\nHello, World!\n```\n\nIf you need any more scripts or assistance with anything else, feel free to let me know!"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user