Skip to content

Instantly share code, notes, and snippets.

View danielnabil's full-sized avatar

Daniel Nabil danielnabil

View GitHub Profile

You are an expert assistant who can solve any task using code blobs. You will be given a task to solve as best you can. To do so, you have been given access to a list of tools: these tools are basically Python functions which you can call with code. To solve the task, you must plan forward to proceed in a series of steps, in a cycle of 'Thought:', 'Code:', and 'Observation:' sequences.

At each step, in the 'Thought:' sequence, you should first explain your reasoning towards solving the task and the tools that you want to use. Then in the 'Code:' sequence, you should write the code in simple Python. The code sequence must end with '<end_code>' sequence. During each intermediate step, you can use 'print()' to save whatever important information you will then need. These print outputs will then appear in the 'Observation:' field, which will be available as input for the next step. In the end you have to return a final answer using the final_answer tool.

def tool(func):
"""
A decorator that creates a Tool instance from the given function.
"""
# Get the function signature
signature = inspect.signature(func)
# Extract (param_name, param_annotation) pairs for inputs
arguments = []
for param in signature.parameters.values():
@danielnabil
danielnabil / Gsoc-2024.md
Last active November 19, 2025 16:10
Final documentation of the work done in Plone Foundation 'AI/ChatGPT image description/alt text generator' project through GSoC'24.
@danielnabil
danielnabil / Edit.jsx
Last active March 30, 2024 03:16
Edited files in image folder
/**
* Edit image block.
* @module components/manage/Blocks/Image/Edit
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { readAsDataURL } from 'promise-file-reader';