-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated gemini and deepseek chat models. (#204)
* Integrated gemini and deepseel chat models. * Fixed unittests. * Updated changelog.
- Loading branch information
Showing
15 changed files
with
444 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from enum import StrEnum | ||
|
||
|
||
class ModelName(StrEnum): | ||
CLAUDE_3_5_SONNET_20241022 = "claude-3-5-sonnet-20241022" | ||
CLAUDE_3_5_HAIKU_20241022 = "claude-3-5-haiku-20241022" | ||
GPT_4O_2024_11_20 = "gpt-4o-2024-11-20" | ||
GPT_4O_MINI_2024_07_18 = "gpt-4o-mini-2024-07-18" | ||
GEMINI_2_0_FLASH_EXP = "gemini-2.0-flash-exp" | ||
GEMINI_2_0_FLASH_THINKING_EXP_01_21 = "gemini-2.0-flash-thinking-exp-01-21" | ||
DEEPSEEK_CHAT = "deepseek-chat" | ||
DEEPSEEK_REASONER = "deepseek-reasoner" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import logging | ||
|
||
from django.core.management.base import BaseCommand | ||
|
||
from automation.agents.codebase_search.agent import CodebaseSearchAgent | ||
from codebase.clients import RepoClient | ||
from codebase.indexes import CodebaseIndex | ||
|
||
logger = logging.getLogger("daiv.indexes") | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Search documents in the index." | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument("--repo-id", type=str, help="Update a specific repository by namepsace, slug or id.") | ||
parser.add_argument( | ||
"--ref", | ||
type=str, | ||
help="Update a specific reference of the repository. If not provided, the default branch will be used.", | ||
) | ||
parser.add_argument("--show-content", action="store_true", help="Show the content of the documents.") | ||
parser.add_argument("query", type=str, help="The query to search for.") | ||
|
||
def handle(self, *args, **options): | ||
repo_client = RepoClient.create_instance() | ||
indexer = CodebaseIndex(repo_client=repo_client) | ||
|
||
namespace = None | ||
|
||
if options["repo_id"]: | ||
namespace = indexer._get_codebase_namespace(options["repo_id"], options["ref"]) | ||
|
||
codebase_search = CodebaseSearchAgent(indexer.as_retriever(namespace)) | ||
|
||
for doc in codebase_search.agent.invoke(options["query"]): | ||
self.stdout.write("-" * 100) | ||
self.stdout.write(f"{doc.metadata['repo_id']}[{doc.metadata['ref']}]: {doc.metadata['source']}\n") | ||
if options["show_content"]: | ||
self.stdout.write(doc.page_content) | ||
self.stdout.write("-" * 100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
# Codebase | ||
CODEBASE_GITLAB_AUTH_TOKEN= | ||
|
||
# Models | ||
OPENAI_API_KEY= | ||
ANTHROPIC_API_KEY= | ||
DEEPSEEK_API_KEY= | ||
GOOGLE_API_KEY= | ||
|
||
# Monitoring | ||
LANGCHAIN_API_KEY= | ||
|
||
# WebSearch | ||
TAVILY_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.