Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌐 Basics of web search #347

Merged
merged 38 commits into from
May 1, 2023
Merged

🌐 Basics of web search #347

merged 38 commits into from
May 1, 2023

Conversation

asim-shrestha
Copy link
Contributor

@asim-shrestha asim-shrestha commented Apr 25, 2023

  • Update array extraction logic and add more tests
  • Introduce an analysis step for the agent to determine what tool / action to take
  • When "search" is used, use a clone of the langchain serper tool to search google for a query and summarize results
  • this does NOT actually scrape website results, but we should look into this in the future
  • Add a switch on the front page to ENABLE / DISABLE web search

Image when searching:
image

Image for when SERP_API is not in ENV: (Will still build)
image

@asim-shrestha asim-shrestha requested a review from awtkns April 25, 2023 07:55
@vercel
Copy link

vercel bot commented Apr 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agent-gpt ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2023 4:22am

@asim-shrestha asim-shrestha marked this pull request as ready for review April 25, 2023 23:56
@awtkns
Copy link
Member

awtkns commented Apr 29, 2023

@asim-shrestha whats the plan for this

Copy link
Member

@awtkns awtkns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, lets send it!

@@ -16,4 +16,44 @@ describe("Strings should be extracted from arrays correctly", () => {
"Integrate with external tools and services to provide users with additional features such as task prioritization and scheduling."
);
});

it("fails with single quotes", () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐐 Love to see it!


async executeTask(task: string, analysis: Analysis): Promise<string> {
// Run search server side since clients won't have a key
if (this.shouldRunClientSide() && analysis.action !== "search") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant wait to remove this client side stuff. It will help to reduce our package size :)

knowledgeGraph?: KnowledgeGraph;
organic?: OrganicResult[];
relatedSearches?: RelatedSearch[];
sportsResults?: SportsResults;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is oddly specific for a web search api 😆

const options = {
method: "POST",
headers: {
"X-API-KEY": this.key,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding this key are we going to get ratelimitted here?

constructor(modelSettings: ModelSettings, goal: string) {
super();

this.key = process.env.SERP_API_KEY ?? "";
Copy link
Member

@awtkns awtkns May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put the SERP_API_KEY in the environment schema as an optional.

@awtkns
Copy link
Member

awtkns commented May 1, 2023

Screen Shot 2023-05-01 at 6 45 54 AM

Preview still seems to have a few issues

@asim-shrestha asim-shrestha merged commit 4b9272d into main May 1, 2023
@asim-shrestha asim-shrestha deleted the search branch May 2, 2023 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants