-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
607 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This assigns @JayGhiya as the code owner for all files in the repository | ||
* @JayGhiya |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
65 changes: 65 additions & 0 deletions
65
unoplat-code-confluence/unoplat_code_confluence/configuration/external_config.py
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,65 @@ | ||
# Standard Library | ||
from enum import Enum | ||
from typing import Any, Dict, List | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field, ValidationInfo, field_validator | ||
|
||
|
||
class ProgrammingLanguage(Enum): | ||
PYTHON = 'python' | ||
JAVA = 'java' | ||
# JAVASCRIPT = 'JavaScript' | ||
# CSHARP = 'C#' | ||
# RUBY = 'Ruby' | ||
# GO = 'Go' | ||
# KOTLIN = 'Kotlin' | ||
# SWIFT = 'Swift' | ||
|
||
|
||
class RepoConfig(BaseModel): | ||
download_url: str | ||
download_directory: str | ||
|
||
class AppConfig(BaseModel): | ||
local_workspace_path: str | ||
output_path: str | ||
output_file_name: str | ||
codebase_name: str | ||
programming_language: str | ||
repo: RepoConfig | ||
api_tokens: Dict[str, str] | ||
llm_provider_config: Dict[str, Any] = Field( | ||
description="Configuration for the LLM provider based on litellm", | ||
example={ | ||
"model_provider": "openai/gpt-4", | ||
"model_provider_args": { | ||
"api_key": "sk-...", | ||
"max_tokens": 500, | ||
"temperature": 0.0 | ||
} | ||
} | ||
) | ||
handlers: List[Dict[str, Any]] = Field(default_factory=list,alias="logging_handlers") | ||
parallisation: int = 1 | ||
json_output: bool = False | ||
sentence_transformer_model: str = Field(default="jinaai/jina-embeddings-v3", description="Name or path of the sentence transformer model") | ||
neo4j_uri: str = Field(default="bolt://localhost:7687", description="URI of the Neo4j database") | ||
neo4j_username: str = Field(default="neo4j", description="Username for the Neo4j database") | ||
neo4j_password: str = Field(default="Ke7Rk7jB:Jn2Uz:", description="Password for the Neo4j database") | ||
|
||
@field_validator('programming_language') | ||
def check_programming_language(cls, value, info:ValidationInfo): | ||
if value not in [member.value for member in ProgrammingLanguage]: | ||
raise ValueError("programming_language must be a valid programming language") | ||
return value | ||
|
||
|
||
@field_validator('api_tokens') | ||
def check_api_tokens(cls, value, info:ValidationInfo): | ||
if 'github_token' not in value: | ||
raise ValueError("github_token is required in api_tokens") | ||
if len(value) != 1: | ||
raise ValueError("api_tokens must only contain github_token") | ||
return value | ||
|
2 changes: 2 additions & 0 deletions
2
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi/chapi_functioncall.py
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
3 changes: 3 additions & 0 deletions
3
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi_forge/unoplat_package.py
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
17 changes: 17 additions & 0 deletions
17
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi_unoplat_annotation.py
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,17 @@ | ||
# Standard Library | ||
from typing import Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
# First Party | ||
from unoplat_code_confluence.data_models.chapi_unoplat_annotation_key_val import \ | ||
ChapiUnoplatAnnotationKeyVal | ||
from unoplat_code_confluence.data_models.chapi_unoplat_position import Position | ||
|
||
|
||
class Annotation(BaseModel): | ||
name: Optional[str] = Field(default=None, alias="Name") | ||
key_values: Optional[list[ChapiUnoplatAnnotationKeyVal]] = Field(default_factory=list, alias="KeyValues") | ||
position: Optional[Position] = Field(default=None, alias="Position") | ||
|
16 changes: 16 additions & 0 deletions
16
...lat-code-confluence/unoplat_code_confluence/data_models/chapi_unoplat_class_fieldmodel.py
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,16 @@ | ||
# Standard Library | ||
from typing import List, Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
# First Party | ||
from unoplat_code_confluence.data_models.chapi_unoplat_annotation import \ | ||
Annotation | ||
|
||
|
||
class ClassFieldModel(BaseModel): | ||
type_type: Optional[str] = Field(default=None, alias="TypeType",description="Class Field Type") | ||
type_key: Optional[str] = Field(default=None, alias="TypeKey",description="Class Field Name") | ||
annotations: Optional[List[Annotation]]= Field(default=None, alias="Annotations",description="Class Field Annotation") | ||
|
14 changes: 14 additions & 0 deletions
14
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi_unoplat_codebase.py
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,14 @@ | ||
# Standard Library | ||
from typing import List, Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
# First Party | ||
from unoplat_code_confluence.data_models.chapi_unoplat_package import \ | ||
UnoplatPackage | ||
|
||
|
||
class UnoplatCodebase(BaseModel): | ||
packages: Optional[UnoplatPackage] = Field(default=None, alias="UnoplatPackages") | ||
|
26 changes: 26 additions & 0 deletions
26
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi_unoplat_function.py
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,26 @@ | ||
# Standard Library | ||
from typing import List, Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
# First Party | ||
from unoplat_code_confluence.data_models.chapi_unoplat_annotation import \ | ||
Annotation | ||
from unoplat_code_confluence.data_models.chapi_unoplat_functioncall import \ | ||
FunctionCall | ||
from unoplat_code_confluence.data_models.chapi_unoplat_position import Position | ||
from unoplat_code_confluence.data_models.unoplat_function_field_model import \ | ||
UnoplatFunctionFieldModel | ||
|
||
|
||
class ChapiUnoplatFunction(BaseModel): | ||
name: Optional[str] = Field(default=None, alias="Name") | ||
return_type: Optional[str] = Field(default=None, alias="ReturnType") | ||
function_calls: List[FunctionCall] = Field(default_factory=list, alias="FunctionCalls") | ||
annotations: List[Annotation] = Field(default_factory=list, alias="Annotations") | ||
position: Optional[Position] = Field(default=None, alias="Position",exclude=True) | ||
local_variables: List[UnoplatFunctionFieldModel] = Field(default_factory=list, alias="LocalVariables") | ||
body_hash: Optional[int] = Field(default=None, alias="BodyHash",exclude=True) | ||
content: Optional[str] = Field(default=None, alias="Content") | ||
|
11 changes: 11 additions & 0 deletions
11
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi_unoplat_import.py
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,11 @@ | ||
# Standard Library | ||
from typing import List, Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
|
||
class Import(BaseModel): | ||
source: Optional[str] = Field(default=None, alias="Source") | ||
usage_name: List[str] = Field(default_factory=list, alias="UsageName") | ||
|
32 changes: 32 additions & 0 deletions
32
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi_unoplat_node.py
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,32 @@ | ||
# Standard Library | ||
from typing import List, Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
# First Party | ||
from unoplat_code_confluence.data_models.chapi_unoplat_annotation import \ | ||
Annotation | ||
from unoplat_code_confluence.data_models.chapi_unoplat_class_fieldmodel import \ | ||
ClassFieldModel | ||
from unoplat_code_confluence.data_models.chapi_unoplat_function import \ | ||
ChapiUnoplatFunction | ||
from unoplat_code_confluence.data_models.chapi_unoplat_import import Import | ||
from unoplat_code_confluence.data_models.chapi_unoplat_position import Position | ||
|
||
|
||
class ChapiUnoplatNode(BaseModel): | ||
node_name: Optional[str] = Field(default=None, alias="NodeName") | ||
type: Optional[str] = Field(default=None, alias="Type") | ||
file_path: Optional[str] = Field(default=None, alias="FilePath",exclude=True) | ||
module: Optional[str] = Field(default=None, alias="Module",exclude=True) | ||
package: Optional[str] = Field(default=None, alias="Package",exclude=True) | ||
multiple_extend: Optional[list[str]] = Field(default_factory=list, alias="MultipleExtend") | ||
fields: List[ClassFieldModel] = Field(default_factory=list, alias="Fields") | ||
extend: Optional[str] = Field(default=None, alias="Extend") | ||
imports: List[Import] = Field(default_factory=list, alias="Imports") | ||
functions: List[ChapiUnoplatFunction] = Field(default_factory=list, alias="Functions") | ||
position: Optional[Position] = Field(default=None, alias="Position",exclude=True) | ||
content: Optional[str] = Field(default=None, alias="Content",exclude=True) | ||
annotations: List[Annotation] = Field(default_factory=list, alias="Annotations") | ||
|
11 changes: 11 additions & 0 deletions
11
unoplat-code-confluence/unoplat_code_confluence/data_models/chapi_unoplat_parameter.py
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,11 @@ | ||
# Standard Library | ||
from typing import Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
|
||
class Parameter(BaseModel): | ||
type_value: Optional[str] = Field(default=None, alias="TypeValue") | ||
type_type: Optional[str] = Field(default=None, alias="TypeType") | ||
|
24 changes: 24 additions & 0 deletions
24
...lat-code-confluence/unoplat_code_confluence/data_models/dspy/dspy_unoplat_node_summary.py
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,24 @@ | ||
# Standard Library | ||
from typing import Any, Dict, List, Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
# First Party | ||
from unoplat_code_confluence.data_models.chapi_unoplat_class_fieldmodel import \ | ||
ClassFieldModel | ||
from unoplat_code_confluence.data_models.chapi_unoplat_node import \ | ||
ChapiUnoplatNode | ||
from unoplat_code_confluence.data_models.dspy.dspy_unoplat_function_summary import \ | ||
DspyUnoplatFunctionSummary | ||
|
||
|
||
class DspyUnoplatNodeSummary(ChapiUnoplatNode): | ||
qualified_name: str = Field(required=True, alias="QualifiedName",description="The qualified name of the class that contains the entire hierarchy of the class") | ||
node_summary: str = Field(required=True, alias="NodeSummary",description="A summary of the class") | ||
node_objective: str = Field(required=True, alias="NodeObjective",description="The objective of the class") | ||
functions_summary: Optional[List[DspyUnoplatFunctionSummary]] = Field(default=None, alias="FunctionsSummary",description="A list of functions in the class") | ||
class_objective_embedding: List[float] = Field(default_factory=list, alias="ClassObjectiveEmbedding") | ||
class_implementation_summary_embedding: List[float] = Field(default_factory=list, alias="ClassImplementationSummaryEmbedding") | ||
|
||
|
4 changes: 4 additions & 0 deletions
4
...uence/unoplat_code_confluence/data_models/forge_summary/forge_unoplat_codebase_summary.py
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
3 changes: 3 additions & 0 deletions
3
...luence/unoplat_code_confluence/data_models/forge_summary/forge_unoplat_package_summary.py
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
11 changes: 11 additions & 0 deletions
11
unoplat-code-confluence/unoplat_code_confluence/data_models/unoplat_function_field_model.py
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,11 @@ | ||
# Standard Library | ||
from typing import Optional | ||
|
||
# Third Party | ||
from pydantic import BaseModel, Field | ||
|
||
|
||
class UnoplatFunctionFieldModel(BaseModel): | ||
type_value: Optional[str] = Field(default=None, alias="TypeValue",description="function field name") | ||
type_type: Optional[str] = Field(default=None, alias="TypeType",description="function field type. Can be incorrect sometime if variable is returned without declaration. So refer content attribute too to understand better.") | ||
|
4 changes: 4 additions & 0 deletions
4
unoplat-code-confluence/unoplat_code_confluence/downloader/downloader.py
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.