Skip to content

Fixed search prompt #563

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

Merged
merged 8 commits into from
Aug 20, 2024
Merged

Fixed search prompt #563

merged 8 commits into from
Aug 20, 2024

Conversation

portoaj
Copy link
Contributor

@portoaj portoaj commented Aug 20, 2024

Currently the search prompt reduces the creativity of the LLM to a detrimental degree to the point that it can't search for anything that isn't presented in an extremely simple input query. In particular, if I try to specify the schema or the answer I want in my prompt the search that is output is unhelpful. Here's an example of a query I'd like to run that fails currently:

graph_config = {
    "llm": {

        "model": "gpt-4o-mini",
    },
    "verbose": True,
    "headless": False,
    "max_results": 5
}

class AnswerModel(BaseModel):
    answer: Literal['yes', 'no']


search_graph = SearchGraph(
    prompt="Does the Alienware Aurora R15 Desktop have bluetooth support? Your output should be of the form: {\"answer\": \"answer here\"}. The answer should be exactly one of these strings: 'yes', 'no'",
    config=graph_config,
    schema=AnswerModel,
)

Here's the search term that gets output currently: Search Query: {"answer": "yes"}
Here's the search term that gets output after my change: Search Query: "Alienware Aurora R15 Desktop bluetooth support"

This simple prompt change should make the search internet node much more useful. In my example, it goes from a completely useless query to the exact query I would've expected.

Please let me know if there are any other changes you think I should make to the prompt to make sure that it doesn't break other people's use cases.

@portoaj portoaj changed the base branch from main to pre/beta August 20, 2024 04:00
@portoaj
Copy link
Contributor Author

portoaj commented Aug 20, 2024

Realized I was merging from/into main instead of pre/beta like the other PRs

@f-aguzzi
Copy link
Member

Thanks for your contribution. I moved your new prompt to a different file, so now everything is ready for merging.

@f-aguzzi f-aguzzi merged commit 0f7d4ac into ScrapeGraphAI:pre/beta Aug 20, 2024
Copy link

🎉 This issue has been resolved in version 1.14.0-beta.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version 1.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants