Spaces:
Runtime error
Runtime error
import nest_asyncio | |
nest_asyncio.apply() | |
# if you plan on using text_to_speech and GPT4-Vision models be sure to use the | |
# correct APIKEY | |
OPENAI_API_KEY = "YOUR API KEY" | |
GOOGLE_API_KEY = "YOUR API KEY" | |
from scrapegraphai.graphs import SearchGraph | |
# Define the configuration for the graph | |
graph_config = { | |
"llm": { | |
"api_key": 'OPENAI_API_KEY', | |
"model": "gpt-3.5-turbo", | |
"temperature": 0, | |
}, | |
} | |
# Create the SearchGraph instance | |
search_graph = SearchGraph( | |
prompt="List me all the attributes of 'cannabis strain'.", | |
config=graph_config | |
) | |
result = search_graph.run() | |
import json | |
output = json.dumps(result, indent=2) | |
line_list = output.split("\n") # Sort of line replacing "\n" with a new line | |
for line in line_list: | |
print(line) |