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

Cells not working / Connection Timed Out (fixed code) - Colab #29

Open
MemeFormer opened this issue Apr 30, 2024 · 0 comments
Open

Cells not working / Connection Timed Out (fixed code) - Colab #29

MemeFormer opened this issue Apr 30, 2024 · 0 comments

Comments

@MemeFormer
Copy link

I tried your shared Google Colab notebook
Open In Colab

I'm not sure if it's intended to be like that or if it's meant to be done differently, but I couldn't get that part to work without altering it.

# Here you pass your own GROQ API key

Sending POST request, with full functions implementation

from dotenv import load_dotenv
from duckduckgo_search import DDGS
import requests, os
import json

load_dotenv()

api_key = os.getenv("<your_groq_api_key>")

header = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}
proxy_url = "https://groqcall.ai/proxy/groq/v1/chat/completions"

But then received a ConnectTimeout error while making an API request, resulting in an APITimeoutError due to a timed-out request.

Screen Shot 2024-04-30 at 8 05 03 AM

Schema-less Function Call 🤩

from dotenv import load_dotenv
from duckduckgo_search import DDGS
import requests, os
import json

load_dotenv()

api_key = os.getenv("<your_groq_api_key>")
Screen Shot 2024-04-30 at 8 49 24 AM

Using with PhiData (Or similar libraries)

from phi.llm.openai.like import OpenAILike
from phi.assistant import Assistant
from phi.tools.duckduckgo import DuckDuckGo
import os, json
import dotenv

load_dotenv()


api_key = os.getenv("<your_groq_api_key>")

Uploading Screen Shot 2024-04-30 at 8.52.03 AM.png…

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

No branches or pull requests

1 participant