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

[PR revoked] add llama-3 and mixtral model for ai chat #225

Merged
merged 7 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def chat(self, keywords: str, model: str = "gpt-3.5") -> str:

Args:
keywords (str): The initial message or question to send to the AI.
model (str): The model to use: "gpt-3.5", "claude-3-haiku". Defaults to "gpt-3.5".
model (str): The model to use: "gpt-3.5", "claude-3-haiku", "llama-3-70b", "mixtral-8x7b". Defaults to "gpt-3.5".

Returns:
str: The response from the AI.
Expand Down
2 changes: 1 addition & 1 deletion duckduckgo_search/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def version():
def chat(save, proxy):
"""CLI function to perform an interactive AI chat using DuckDuckGo API."""
cache_file = "ddgs_chat_conversation.json"
models = ["gpt-3.5", "claude-3-haiku"]
models = ["gpt-3.5", "claude-3-haiku", "llama-3-70b", "mixtral-8x7b"]
client = DDGS(proxy=proxy)

print("DuckDuckGo AI chat. Available models:")
Expand Down
10 changes: 8 additions & 2 deletions duckduckgo_search/duckduckgo_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,18 @@ def chat(self, keywords: str, model: str = "gpt-3.5") -> str:

Args:
keywords (str): The initial message or question to send to the AI.
model (str): The model to use: "gpt-3.5", "claude-3-haiku". Defaults to "gpt-3.5".
model (str): The model to use: "gpt-3.5", "claude-3-haiku", "llama-3-70b", "mixtral-8x7b".
Defaults to "gpt-3.5".

Returns:
str: The response from the AI.
"""
models = {"claude-3-haiku": "claude-3-haiku-20240307", "gpt-3.5": "gpt-3.5-turbo-0125"}
models = {
"claude-3-haiku": "claude-3-haiku-20240307",
"gpt-3.5": "gpt-3.5-turbo-0125",
"llama-3-70b": "meta-llama/llama-3-70b-70b-chat-hf",
"mixtral-8x7b": "mistralai/mixtral-8x7b-8x7B-Instruct-v0.1",
}
# vqd
if not self._chat_vqd:
resp = self.client.get("https://duckduckgo.com/duckchat/v1/status", headers={"x-vqd-accept": "1"})
Expand Down
3 changes: 2 additions & 1 deletion duckduckgo_search/duckduckgo_search_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ async def achat(self, keywords: str, model: str = "gpt-3.5") -> str:

Args:
keywords (str): The initial message or question to send to the AI.
model (str): The model to use: "gpt-3.5", "claude-3-haiku". Defaults to "gpt-3.5".
model (str): The model to use: "gpt-3.5", "claude-3-haiku", "llama-3-70b", "mixtral-8x7b".
Defaults to "gpt-3.5".

Returns:
str: The response from the AI.
Expand Down
Loading