mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-12 21:01:56 +08:00
search_internet_node prompt moved
This commit is contained in:
parent
f455fcbc5f
commit
86a4903e99
@ -8,6 +8,7 @@ from langchain_community.chat_models import ChatOllama
|
||||
from ..utils.logging import get_logger
|
||||
from ..utils.research_web import search_on_web
|
||||
from .base_node import BaseNode
|
||||
from ..prompts import search_internet_template
|
||||
|
||||
class SearchInternetNode(BaseNode):
|
||||
"""
|
||||
@ -73,19 +74,8 @@ class SearchInternetNode(BaseNode):
|
||||
|
||||
output_parser = CommaSeparatedListOutputParser()
|
||||
|
||||
search_template = """
|
||||
PROMPT:
|
||||
You are a search engine and you need to generate a search query based on the user's prompt. \n
|
||||
Given the following user prompt, return a query that can be
|
||||
used to search the internet for relevant information. \n
|
||||
You should return only the query string without any additional sentences. \n
|
||||
For example, if the user prompt is "What is the capital of France?",
|
||||
you should return "capital of France". \n
|
||||
If you return something else, you will get a really bad grade. \n
|
||||
USER PROMPT: {user_prompt}"""
|
||||
|
||||
search_prompt = PromptTemplate(
|
||||
template=search_template,
|
||||
template=search_internet_template,
|
||||
input_variables=["user_prompt"],
|
||||
)
|
||||
|
||||
|
||||
@ -8,3 +8,4 @@ from .generate_answer_node_pdf_prompts import template_chunks_pdf, template_no_c
|
||||
from .generate_answer_node_omni_prompts import template_chunks_omni, template_no_chunk_omni, template_merge_omni
|
||||
from .merge_answer_node_prompts import template_combined
|
||||
from .robots_node_prompts import template_robot
|
||||
from .search_internet_node_prompts import search_internet_template
|
||||
@ -1,6 +1,7 @@
|
||||
"""
|
||||
Robot node prompts helper
|
||||
"""
|
||||
|
||||
template_robot = """
|
||||
You are a website scraper and you need to scrape a website.
|
||||
You need to check if the website allows scraping of the provided path. \n
|
||||
|
||||
14
scrapegraphai/prompts/search_internet_node_prompts.py
Normal file
14
scrapegraphai/prompts/search_internet_node_prompts.py
Normal file
@ -0,0 +1,14 @@
|
||||
"""
|
||||
Search internet node prompts helper
|
||||
"""
|
||||
|
||||
search_internet_template = """
|
||||
PROMPT:
|
||||
You are a search engine and you need to generate a search query based on the user's prompt. \n
|
||||
Given the following user prompt, return a query that can be
|
||||
used to search the internet for relevant information. \n
|
||||
You should return only the query string without any additional sentences. \n
|
||||
For example, if the user prompt is "What is the capital of France?",
|
||||
you should return "capital of France". \n
|
||||
If you return something else, you will get a really bad grade. \n
|
||||
USER PROMPT: {user_prompt}"""
|
||||
Loading…
Reference in New Issue
Block a user