Skip to content

Implementation of "mumu-lhl/duckduckgo-ai-chat" into async Python funcs. duckduckgo-ai-chat-py provides the Duckduckgo AI Chat API, which can use gpt-4o-mini for free.

Notifications You must be signed in to change notification settings

tolgakurtuluss/duckduckgo-ai-chat-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

DuckDuckGo Chat API Python Client

A Python client for the DuckDuckGo Chat API to send messages and receive responses asynchronously. With this .ipynb file, you can use GPT-4o mini, Claude 3 Haiku, Llama 3.1 70B, Mixtral 8x7B for free.

Requirements

  • Python 3.7+
  • httpx library

Classes

Model

Available AI models:

  • GPT_4O_MINI
  • CLAUDE_3_HAIKU
  • META_LLAMA
  • MISTRALAI

Usage

Example usage of "gpt-4o-mini"

chat_instance = await init_chat(Model.GPT_4O_MINI)
response = await chat_instance.fetch_full("Merhaba. Nasıl gidiyor?")
print(response)

Example usage of "claude-3-haiku-20240307"

chat_instance = await init_chat(Model.CLAUDE_3_HAIKU)
response = await chat_instance.fetch_full("Merhaba. Nasıl gidiyor?")
print(response)

Example usage of "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"

chat_instance = await init_chat(Model.META_LLAMA)
response = await chat_instance.fetch_full("Merhaba. Nasıl gidiyor?")
print(response)

Example usage of "mistralai/Mixtral-8x7B-Instruct-v0.1"

chat_instance = await init_chat(Model.MISTRALAI)
response = await chat_instance.fetch_full("Merhaba. Nasıl gidiyor?")
print(response)

About

Implementation of "mumu-lhl/duckduckgo-ai-chat" into async Python funcs. duckduckgo-ai-chat-py provides the Duckduckgo AI Chat API, which can use gpt-4o-mini for free.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published