Skip to content

Commit

Permalink
Added parsing for Brave Search Output (#779)
Browse files Browse the repository at this point in the history
Made changes so that a fully typed JSON object is returned by Brave
Search .
This fixes issue #771 
<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Parse Brave Search JSON output into `SearchResult` objects and update
`BraveSearchOutput` to return a list of these objects.
> 
>   - **Behavior**:
> - `search()` in `brave.py` now parses JSON results into `SearchResult`
objects.
> - `BraveSearchOutput` now returns a list of `SearchResult` instead of
a single string.
>   - **Models**:
> - Adds `SearchResult` model in `brave.py` with `title`, `link`, and
`snippet` fields.
> - Updates `BraveSearchOutput` in `brave.py` to use
`List[SearchResult]` for `result`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=julep-ai%2Fjulep&utm_source=github&utm_medium=referral)<sup>
for 61e813a. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Diwank Singh Tomer <[email protected]>
Co-authored-by: vedantsahai18 <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 864a30a commit b324093
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 118 deletions.
12 changes: 6 additions & 6 deletions agents-api/agents_api/activities/task_steps/prompt_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ def format_tool(tool: Tool) -> dict:

formatted["function"]["parameters"] = json_schema

# FIXME: Implement integration tools
elif tool.type == "integration":
raise NotImplementedError("Integration tools are not supported")
# # FIXME: Implement integration tools
# elif tool.type == "integration":
# raise NotImplementedError("Integration tools are not supported")

# FIXME: Implement API call tools
elif tool.type == "api_call":
raise NotImplementedError("API call tools are not supported")
# # FIXME: Implement API call tools
# elif tool.type == "api_call":
# raise NotImplementedError("API call tools are not supported")

return formatted

Expand Down
Loading

0 comments on commit b324093

Please sign in to comment.