Skip to content

Commit

Permalink
chore: solving merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JayGhiya committed Dec 20, 2024
2 parents 6b2afcd + b509efc commit 994c1e4
Show file tree
Hide file tree
Showing 30 changed files with 607 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
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
6 changes: 5 additions & 1 deletion code-confluence/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';
import React from 'react';

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Code confluence',
tagline: 'Powered by Unoplat',
tagline: 'Powered by Unoplat Technologies',
customFields: {
taglineImage: 'img/unoplat_logo.png',
},
favicon: 'img/favicon.ico',

// Set the production url of your site here
Expand Down
2 changes: 1 addition & 1 deletion code-confluence/src/components/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Footer() {
</div>
<div class="text--center">

Copyright © 2024 Code Confluence, Inc.
Copyright © 2024 Unoplat Technologies, Private Limited.
</div>
</div>
</footer>
Expand Down
27 changes: 27 additions & 0 deletions code-confluence/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,31 @@
--ifm-color-primary-lightest: #4fddbf;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}
.hero__title {
text-align: center;
margin-bottom: 0.5em;
font-size: 2.5em;
}

.hero__subtitle {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
text-align: center;
gap: 0.3em; /* increased gap */
margin: 0 auto;
font-size: 1.2em;
}

.hero__subtitle::after {
content: '';
display: inline-block;
background: url('../../static/img/unoplat_logo.png') no-repeat center;
background-size: contain;
height: 1.5em; /* increased height */
width: 6em; /* increased width */
margin: 0;
margin-top: -0.2em;
vertical-align: middle;
}
Binary file added code-confluence/static/img/unoplat_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion scripts/export_data_graph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from neo4j import GraphDatabase
import json

from neo4j import GraphDatabase

# Replace these credentials with your Neo4j database info
uri = "bolt://localhost:7687"
username = "neo4j"
Expand Down
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

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@



# Standard Library
# Standard Library
from typing import List, Optional

# Third Party
# Third Party
from pydantic import BaseModel, Field

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Standard Library
# Standard Library
from typing import Dict, List, Optional

# Third Party

# Third Party
from pydantic import BaseModel, Field
from unoplat_code_confluence.data_models.chapi_forge.unoplat_chapi_forge_node import UnoplatChapiForgeNode
Expand Down
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")

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")

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")

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")

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")

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")

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")

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")


Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Standard Library
# Standard Library
from typing import Dict, Optional

# Third Party
from pydantic import BaseModel, Field

# Third Party
from pydantic import BaseModel, Field

# First Party
from unoplat_code_confluence.data_models.forge_summary.forge_unoplat_package_summary import DspyUnoplatPackageSummary

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Standard Library
# Standard Library
from typing import Dict, List, Optional

# Third Party
from pydantic import BaseModel, Field
# Third Party
from pydantic import BaseModel, Field

Expand Down
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.")

Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Standard Library
# Standard Library
import os
import re # Import regex module

# Third Party
import re # Import regex module

# Third Party
import requests
from github import Github
Expand Down
Loading

0 comments on commit 994c1e4

Please sign in to comment.