08 Creator Agent
* Optional Features: Auto Optimize a Skill¶
creator agent can use open-creator API to create
, search
, save
skills
In [1]:
Copied!
from creator.agents import create_creator_agent
from creator import config
from creator.agents import create_creator_agent
from creator import config
In [2]:
Copied!
open_creator_agent = create_creator_agent(config)
open_creator_agent = create_creator_agent(config)
In [3]:
Copied!
messages = [
{
"role": "user",
"content": "what can you do for me? output in markdown table",
}
]
messages = [
{
"role": "user",
"content": "what can you do for me? output in markdown table",
}
]
In [4]:
Copied!
messages = open_creator_agent.run({"messages": messages})
messages = open_creator_agent.run({"messages": messages})
Output()
In [5]:
Copied!
messages.append(
{
"role": "user",
"content": "create a skill that request is to solve 8 * 8 matrix random maze, and save it"
}
)
messages.append(
{
"role": "user",
"content": "create a skill that request is to solve 8 * 8 matrix random maze, and save it"
}
)
In [6]:
Copied!
messages = open_creator_agent.run({"messages": messages})
messages = open_creator_agent.run({"messages": messages})
Output()
Output()
Output()
Output()
Output()
Output()
Output()
Output()
Output()
Output()
Output()
▌ saved to /Users/gongjunmin/.cache/open_creator/skill_library/solve_maze
Output()
In [7]:
Copied!
messages.append(
{
"role": "user",
"content": "try to search this skill and show skill and skill code"
}
)
messages.append(
{
"role": "user",
"content": "try to search this skill and show skill and skill code"
}
)
In [8]:
Copied!
messages = open_creator_agent.run({"messages": messages})
messages = open_creator_agent.run({"messages": messages})
Output()
Output()
▌ loading vector database...
Skill Details: • Name: solve_random_maze • Description: This skill generates a random 8x8 maze and finds a solution for it. The maze and its solution are represented as 2D arrays, where 1 represents a path and 0 represents a wall or an unvisited cell. The skill uses a depth-first search algorithm to find a path from the top-left corner to the bottom-right corner of the maze. • Version: 1.0.0 • Usage: maze, solution = solve_random_maze() print('Maze:') print(maze) print('Solution:') print(solution) • Parameters: • Returns:
import numpy as np def solve_random_maze(): def solve_maze(maze, x, y, solution): if x == len(maze) - 1 and y == len(maze[0]) - 1: solution[x][y] = 1 return True if x >= 0 and x < len(maze) and y >= 0 and y < len(maze[0]) and maze[x][y] == 0: solution[x][y] = 1 if solve_maze(maze, x + 1, y, solution): return True if solve_maze(maze, x, y + 1, solution): return True solution[x][y] = 0 return False return False while True: maze = np.random.choice([0, 1], size=(8, 8)) maze[0, 0] = 0 maze[7, 7] = 0 solution = np.zeros_like(maze) if solve_maze(maze, 0, 0, solution): return maze, solution
Output()
Last update:
October 31, 2023
Created: October 19, 2023
Created: October 19, 2023