Skip to content

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

Description

@MemeFormer

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…

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions