DuckDuckGo AI Chat Wrapper.
if __name__ == "__main__":
Client = DuckGPT(model="gpt-4o-mini")
histories = [{
"role": "user",
"content": "you are an expert python geek"
}]
question = "How to decode base64 using python"
print(Client.Chat(question, histories))
- Request to duck api using prompt.
- Get list of available models.
gpt-4o-mini
claude-3-haiku-20240307
mistralai/Mixtral-8x7B-Instruct-v0.1
meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
- Upload
worker.js
into cloudflare workers. - Use
duckgpt.XXXX.workers.dev/chat/?prompt=hi&model=gpt-4o-mini
endpoint.
Sample api: duck.gpt-api.workers.dev