Read a file from this agent’s branch, defined by self.active_branch,
which supports PR branches.
:param file_path: the file path
:type file_path: str
Returns
The file decoded as a string, or an error message if not found
Return type
str
run(mode: str, query: str) → str[source]¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
search_code(query: str) → str[source]¶
Searches code in the repository.
# Todo: limit total tokens returned…
Parameters
query (str) – The search query
Returns
A string containing, at most, the top 5 search results
Return type
str
search_issues_and_prs(query: str) → str[source]¶
Searches issues and pull requests in the repository.
Parameters
query (str) – The search query
Returns
A string containing the first 5 issues and pull requests
Return type
str
set_active_branch(branch_name: str) → str[source]¶
Equivalent to git checkout branch_name for this Agent.
Clones formatting from Github.
Returns an Error (as a string) if branch doesn’t exist.
update_file(file_query: str) → str[source]¶
Updates a file with new content.
:param file_query: Contains the file path and the file contents.
The old file contents is wrapped in OLD <<<< and >>>> OLD
The new file contents is wrapped in NEW <<<< and >>>> NEW
For example:
/test/hello.txt
OLD <<<<
Hello Earth!
>>>> OLD
NEW <<<<
Hello Mars!
>>>> NEW
Returns