Skip to content

duckduckgosearchexception #948

Open
Open
@nyck33

Description

@nyck33

Describe the bug
DuckDuckGoSearchException is ?
To Reproduce
Steps to reproduce the behavior:
run this in jupyter:


"""
Example of Search Graph
"""

import os

from dotenv import load_dotenv

from scrapegraphai.graphs import SearchGraph

from china_unis import universities


import openai
from openai import OpenAI
import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Initialize the OpenAI client
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

# List all available models
models = client.models.list()

# Print all models
print("Available OpenAI Models:")
for model in models:
    print(f"- {model.id}")

# Optionally, filter for specific model types
gpt_models = [model.id for model in models if "gpt" in model.id.lower()]
print("\nGPT Models:")
for model in gpt_models:
    print(f"- {model}")


os.environ.clear()


load_dotenv()

# ************************************************
# Define the configuration for the graph
# ************************************************

openai_key = os.getenv("OPENAI_API_KEY")

graph_config = {
    "llm": {
        "api_key": openai_key,
        "model": "openai/gpt-4o-2024-08-06",
    },
    "max_results": 2,
    "verbose": True,
}

prompt = f"""
Get me the contact email addresses of the following universities:
{universities}
"""

# ************************************************
# Create the SearchGraph instance and run it
# ************************************************

search_graph = SearchGraph(
    prompt=prompt, config=graph_config
)

result = search_graph.run()

print(result)



Expected behavior
be able to look up error on github issues or documentation.
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions