databerry icon indicating copy to clipboard operation
databerry copied to clipboard

Databerry API Down?

Open WarpWing opened this issue 1 year ago • 0 comments

Hello all!

I've been trying out Databerry and this thing is absolutely amazing! However, I've been trying to get the API to work so that I can query my agent but I keep getting 404s. Is querying agents only a premium feature?

import json
import requests

def get_agent_response(agent_id, api_key, query):
    url = f'https://api.databerry.ai/agents/query/{agent_id}'
    headers = {
        'Content-Type': 'application/json',
        'Authorization': f'Bearer {api_key}',
    }
    data = {
        'query': query,
    }
    response = requests.post(url, headers=headers, data=json.dumps(data))
    return response

def main():
    agent_id = 'xxxxx'  
    api_key = 'xxxx'  
    query = 'xxx'

    response = get_agent_response(agent_id, api_key, query)
    if response.status_code == 200:
        print(response.json())
    else:
        print(f"Error: received status code {response.status_code}")

if __name__ == '__main__':
    main()

WarpWing avatar May 01 '23 17:05 WarpWing