mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-04 22:50:18 +00:00
camel support 0.2.76a1
This commit is contained in:
parent
c0dbb5f35d
commit
fc323b6670
6 changed files with 926 additions and 935 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import asyncio
|
||||
import os
|
||||
from typing import List
|
||||
from camel.toolkits import FileWriteToolkit as BaseFileWriteToolkit
|
||||
from camel.toolkits import FileToolkit as BaseFileToolkit
|
||||
from app.component.environment import env
|
||||
from app.service.task import process_task
|
||||
from app.service.task import ActionWriteFileData, Agents, get_task_lock
|
||||
|
|
@ -9,7 +9,7 @@ from app.utils.listen.toolkit_listen import listen_toolkit
|
|||
from app.utils.toolkit.abstract_toolkit import AbstractToolkit
|
||||
|
||||
|
||||
class FileWriteToolkit(BaseFileWriteToolkit, AbstractToolkit):
|
||||
class FileToolkit(BaseFileToolkit, AbstractToolkit):
|
||||
agent_name: str = Agents.document_agent
|
||||
|
||||
def __init__(
|
||||
|
|
@ -26,7 +26,7 @@ class FileWriteToolkit(BaseFileWriteToolkit, AbstractToolkit):
|
|||
self.api_task_id = api_task_id
|
||||
|
||||
@listen_toolkit(
|
||||
BaseFileWriteToolkit.write_to_file,
|
||||
BaseFileToolkit.write_to_file,
|
||||
lambda _,
|
||||
title,
|
||||
content,
|
||||
|
|
@ -54,3 +54,15 @@ class FileWriteToolkit(BaseFileWriteToolkit, AbstractToolkit):
|
|||
)
|
||||
)
|
||||
return res
|
||||
|
||||
@listen_toolkit(
|
||||
BaseFileToolkit.read_file,
|
||||
)
|
||||
def read_file(self, file_paths: str | list[str]) -> str | dict[str, str]:
|
||||
return super().read_file(file_paths)
|
||||
|
||||
@listen_toolkit(
|
||||
BaseFileToolkit.edit_file,
|
||||
)
|
||||
def edit_file(self, file_path: str, old_content: str, new_content: str) -> str:
|
||||
return super().edit_file(file_path, old_content, new_content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue