osa_tool 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- osa_tool/__init__.py +0 -0
- osa_tool/analytics/__init__.py +0 -0
- osa_tool/analytics/metadata.py +273 -0
- osa_tool/arguments_parser.py +62 -0
- osa_tool/config/standart/settings/config.toml +41 -0
- osa_tool/config/standart/settings/prompts.toml +91 -0
- osa_tool/config/standart/templates/ITMO_template.toml +165 -0
- osa_tool/config/with_article/settings/config.toml +41 -0
- osa_tool/config/with_article/settings/prompts.toml +91 -0
- osa_tool/config/with_article/templates/ITMO_template.toml +29 -0
- osa_tool/github_agent/__init__.py +0 -0
- osa_tool/github_agent/github_agent.py +263 -0
- osa_tool/osatreesitter/__init__.py +0 -0
- osa_tool/osatreesitter/docgen.py +441 -0
- osa_tool/osatreesitter/models.py +400 -0
- osa_tool/osatreesitter/osa_treesitter.py +476 -0
- osa_tool/readmeai/LICENSE +21 -0
- osa_tool/readmeai/README.md +6 -0
- osa_tool/readmeai/__init__.py +0 -0
- osa_tool/readmeai/config/__init__.py +0 -0
- osa_tool/readmeai/config/constants.py +50 -0
- osa_tool/readmeai/config/settings/commands.toml +46 -0
- osa_tool/readmeai/config/settings/contributing_config.toml +28 -0
- osa_tool/readmeai/config/settings/docs_list.toml +29 -0
- osa_tool/readmeai/config/settings/ignore_list.toml +143 -0
- osa_tool/readmeai/config/settings/languages.toml +70 -0
- osa_tool/readmeai/config/settings/parsers.toml +184 -0
- osa_tool/readmeai/config/settings/quickstart.toml +471 -0
- osa_tool/readmeai/config/settings/quickstart_config.toml +55 -0
- osa_tool/readmeai/config/settings/tool_config.toml +666 -0
- osa_tool/readmeai/config/settings/tooling.toml +192 -0
- osa_tool/readmeai/config/settings.py +259 -0
- osa_tool/readmeai/errors.py +131 -0
- osa_tool/readmeai/generators/__init__.py +0 -0
- osa_tool/readmeai/generators/badges.py +112 -0
- osa_tool/readmeai/generators/builder.py +189 -0
- osa_tool/readmeai/generators/quickstart.py +163 -0
- osa_tool/readmeai/generators/svg/shieldsio_icons.json +12294 -0
- osa_tool/readmeai/generators/svg/skill_icons.json +204 -0
- osa_tool/readmeai/ingestion/__init__.py +0 -0
- osa_tool/readmeai/ingestion/file_processor.py +87 -0
- osa_tool/readmeai/ingestion/metadata_extractor.py +72 -0
- osa_tool/readmeai/ingestion/models.py +43 -0
- osa_tool/readmeai/ingestion/pipeline.py +52 -0
- osa_tool/readmeai/logger.py +112 -0
- osa_tool/readmeai/models/__init__.py +0 -0
- osa_tool/readmeai/models/base.py +178 -0
- osa_tool/readmeai/models/prompts.py +81 -0
- osa_tool/readmeai/models/tokens.py +81 -0
- osa_tool/readmeai/parsers/__init__.py +0 -0
- osa_tool/readmeai/parsers/base.py +40 -0
- osa_tool/readmeai/parsers/cpp.py +100 -0
- osa_tool/readmeai/parsers/docker.py +107 -0
- osa_tool/readmeai/parsers/factory.py +75 -0
- osa_tool/readmeai/parsers/go.py +33 -0
- osa_tool/readmeai/parsers/gradle.py +65 -0
- osa_tool/readmeai/parsers/maven.py +35 -0
- osa_tool/readmeai/parsers/npm.py +32 -0
- osa_tool/readmeai/parsers/properties.py +265 -0
- osa_tool/readmeai/parsers/python.py +167 -0
- osa_tool/readmeai/parsers/rust.py +45 -0
- osa_tool/readmeai/parsers/swift.py +55 -0
- osa_tool/readmeai/postprocessor/__init__.py +0 -0
- osa_tool/readmeai/postprocessor/response_cleaner.py +92 -0
- osa_tool/readmeai/preprocessor/__init__.py +0 -0
- osa_tool/readmeai/preprocessor/directory_cleaner.py +25 -0
- osa_tool/readmeai/preprocessor/document_cleaner.py +103 -0
- osa_tool/readmeai/preprocessor/file_filter.py +31 -0
- osa_tool/readmeai/readers/__init__.py +0 -0
- osa_tool/readmeai/readers/git/__init__.py +0 -0
- osa_tool/readmeai/readme_core.py +105 -0
- osa_tool/readmeai/readmegen_article/__init__.py +1 -0
- osa_tool/readmeai/readmegen_article/config/__init__.py +1 -0
- osa_tool/readmeai/readmegen_article/config/settings.py +140 -0
- osa_tool/readmeai/readmegen_article/generators/__init__.py +1 -0
- osa_tool/readmeai/readmegen_article/generators/builder.py +42 -0
- osa_tool/readmeai/readmegen_article/models/__init__.py +1 -0
- osa_tool/readmeai/readmegen_article/models/prompts.py +109 -0
- osa_tool/readmeai/readmegen_article/parser/__init__.py +1 -0
- osa_tool/readmeai/readmegen_article/parser/article_finder.py +90 -0
- osa_tool/readmeai/readmegen_article/parser/pdf_parser.py +134 -0
- osa_tool/readmeai/readmegen_article/templates/__init__.py +1 -0
- osa_tool/readmeai/readmegen_article/templates/header.py +36 -0
- osa_tool/readmeai/templates/__init__.py +0 -0
- osa_tool/readmeai/templates/base.py +11 -0
- osa_tool/readmeai/templates/contributing.py +105 -0
- osa_tool/readmeai/templates/header.py +36 -0
- osa_tool/readmeai/templates/quickstart.py +136 -0
- osa_tool/readmeai/utils/__init__.py +0 -0
- osa_tool/readmeai/utils/file_handler.py +164 -0
- osa_tool/readmeai/utils/file_resource.py +42 -0
- osa_tool/readmeai/utils/helpers.py +10 -0
- osa_tool/translation/dir_translator.py +322 -0
- osa_tool/utils.py +18 -0
- osa_tool-0.1.0.dist-info/LICENSE +30 -0
- osa_tool-0.1.0.dist-info/METADATA +314 -0
- osa_tool-0.1.0.dist-info/RECORD +98 -0
- osa_tool-0.1.0.dist-info/WHEEL +4 -0
osa_tool/__init__.py
ADDED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import functools
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from functools import lru_cache
|
|
7
|
+
from pydantic import (
|
|
8
|
+
BaseModel,
|
|
9
|
+
Field,
|
|
10
|
+
HttpUrl,
|
|
11
|
+
field_validator,
|
|
12
|
+
model_validator,
|
|
13
|
+
)
|
|
14
|
+
import requests
|
|
15
|
+
from rich.logging import RichHandler
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from osa_tool.readmeai.errors import GitURLError
|
|
18
|
+
|
|
19
|
+
logging.basicConfig(
|
|
20
|
+
level=logging.INFO,
|
|
21
|
+
format="%(asctime)s - %(message)s",
|
|
22
|
+
datefmt="[%X]",
|
|
23
|
+
handlers=[RichHandler()]
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
logger = logging.getLogger("rich")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class RepositoryMetadata:
|
|
31
|
+
"""
|
|
32
|
+
Dataclass to store GitHub repository metadata.
|
|
33
|
+
"""
|
|
34
|
+
name: str
|
|
35
|
+
full_name: str
|
|
36
|
+
owner: str
|
|
37
|
+
owner_url: str | None
|
|
38
|
+
description: str | None
|
|
39
|
+
|
|
40
|
+
# Repository statistics
|
|
41
|
+
stars_count: int
|
|
42
|
+
forks_count: int
|
|
43
|
+
watchers_count: int
|
|
44
|
+
open_issues_count: int
|
|
45
|
+
|
|
46
|
+
# Repository details
|
|
47
|
+
default_branch: str
|
|
48
|
+
created_at: str
|
|
49
|
+
updated_at: str
|
|
50
|
+
pushed_at: str
|
|
51
|
+
size_kb: int
|
|
52
|
+
|
|
53
|
+
# Repository URLs
|
|
54
|
+
clone_url_http: str
|
|
55
|
+
clone_url_ssh: str
|
|
56
|
+
contributors_url: str | None
|
|
57
|
+
languages_url: str
|
|
58
|
+
issues_url: str | None
|
|
59
|
+
|
|
60
|
+
# Programming languages and topics
|
|
61
|
+
language: str | None
|
|
62
|
+
languages: list[str]
|
|
63
|
+
topics: list[str]
|
|
64
|
+
|
|
65
|
+
# Additional repository settings
|
|
66
|
+
has_wiki: bool
|
|
67
|
+
has_issues: bool
|
|
68
|
+
has_projects: bool
|
|
69
|
+
is_private: bool
|
|
70
|
+
homepage_url: str | None
|
|
71
|
+
|
|
72
|
+
# License information
|
|
73
|
+
license_name: str | None
|
|
74
|
+
license_url: str | None
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _parse_repository_metadata(repo_data: dict) -> RepositoryMetadata:
|
|
78
|
+
"""
|
|
79
|
+
Converts raw repository data from GitHub API into dataclass.
|
|
80
|
+
"""
|
|
81
|
+
languages = repo_data.get("languages", {})
|
|
82
|
+
license_info = repo_data.get("license", {}) or {}
|
|
83
|
+
owner_info = repo_data.get("owner", {}) or {}
|
|
84
|
+
|
|
85
|
+
return RepositoryMetadata(
|
|
86
|
+
name=repo_data.get("name", ""),
|
|
87
|
+
full_name=repo_data.get("full_name", ""),
|
|
88
|
+
owner=owner_info.get("login", ""),
|
|
89
|
+
owner_url=owner_info.get("html_url", ""),
|
|
90
|
+
description=repo_data.get("description", ""),
|
|
91
|
+
stars_count=repo_data.get("stargazers_count", 0),
|
|
92
|
+
forks_count=repo_data.get("forks_count", 0),
|
|
93
|
+
watchers_count=repo_data.get("watchers_count", 0),
|
|
94
|
+
open_issues_count=repo_data.get("open_issues_count", 0),
|
|
95
|
+
default_branch=repo_data.get("default_branch", ""),
|
|
96
|
+
created_at=repo_data.get("created_at", ""),
|
|
97
|
+
updated_at=repo_data.get("updated_at", ""),
|
|
98
|
+
pushed_at=repo_data.get("pushed_at", ""),
|
|
99
|
+
size_kb=repo_data.get("size", 0),
|
|
100
|
+
clone_url_http=repo_data.get("clone_url", ""),
|
|
101
|
+
clone_url_ssh=repo_data.get("ssh_url", ""),
|
|
102
|
+
contributors_url=repo_data.get("contributors_url"),
|
|
103
|
+
languages_url=repo_data.get("languages_url", ""),
|
|
104
|
+
issues_url=repo_data.get("issues_url"),
|
|
105
|
+
language=repo_data.get("language", ""),
|
|
106
|
+
languages=list(languages.keys()) if languages else [],
|
|
107
|
+
topics=repo_data.get("topics", []),
|
|
108
|
+
has_wiki=repo_data.get("has_wiki", False),
|
|
109
|
+
has_issues=repo_data.get("has_issues", False),
|
|
110
|
+
has_projects=repo_data.get("has_projects", False),
|
|
111
|
+
is_private=repo_data.get("private", False),
|
|
112
|
+
homepage_url=repo_data.get("homepage", ""),
|
|
113
|
+
license_name=license_info.get("name", ""),
|
|
114
|
+
license_url=license_info.get("url", ""),
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _get_base_repo_url(repo_url: str = None) -> str:
|
|
119
|
+
"""Extracts the base repository URL path from a given GitHub URL.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
repo_url (str, optional): The GitHub repository URL. If not provided,
|
|
123
|
+
the instance's `repo_url` attribute is used. Defaults to None.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
str: The base repository path (e.g., 'username/repo-name').
|
|
127
|
+
|
|
128
|
+
Raises:
|
|
129
|
+
ValueError: If the provided URL does not start with 'https://github.com/'.
|
|
130
|
+
"""
|
|
131
|
+
if repo_url.startswith("https://github.com/"):
|
|
132
|
+
base_repo_path = repo_url[len("https://github.com/"):].rstrip('/')
|
|
133
|
+
return f"https://api.github.com/repos/{base_repo_path}"
|
|
134
|
+
else:
|
|
135
|
+
raise ValueError("Unsupported repository URL format.")
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@lru_cache(maxsize=1)
|
|
139
|
+
def load_data_metadata(repo_url: str) -> RepositoryMetadata | None:
|
|
140
|
+
"""
|
|
141
|
+
Retrieves GitHub repository metadata and returns a dataclass.
|
|
142
|
+
"""
|
|
143
|
+
try:
|
|
144
|
+
headers = {
|
|
145
|
+
"Authorization": f"token {os.getenv('GIT_TOKEN')}",
|
|
146
|
+
"Accept": "application/vnd.github.v3+json"
|
|
147
|
+
}
|
|
148
|
+
url = _get_base_repo_url(repo_url)
|
|
149
|
+
|
|
150
|
+
response = requests.get(url=url, headers=headers)
|
|
151
|
+
|
|
152
|
+
metadata = response.json()
|
|
153
|
+
logger.info(f"Successfully fetched metadata for repository: {repo_url}")
|
|
154
|
+
return _parse_repository_metadata(metadata)
|
|
155
|
+
except requests.RequestException as exc:
|
|
156
|
+
logger.error(f"Error while fetching repository metadata: {exc}")
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class GitHost(enum.Enum):
|
|
160
|
+
"""
|
|
161
|
+
Git repository hosting providers.
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
GITHUB = (
|
|
165
|
+
"github.com",
|
|
166
|
+
"https://api.github.com/repos/",
|
|
167
|
+
"https://github.com/{full_name}/blob/main/{file_path}",
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
def __init__(self, name: str, api_url: str, file_url_template: str):
|
|
171
|
+
self.domain = name
|
|
172
|
+
self.api_url = api_url
|
|
173
|
+
self.file_url_template = file_url_template
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class GitURL(BaseModel):
|
|
177
|
+
"""
|
|
178
|
+
Git repository URL model with validation and parsing methods.
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
url: HttpUrl
|
|
182
|
+
host: GitHost | None = Field(default=None)
|
|
183
|
+
host_domain: str = Field(default="")
|
|
184
|
+
name: str = Field(default="")
|
|
185
|
+
full_name: str = Field(default="")
|
|
186
|
+
|
|
187
|
+
model_config = {
|
|
188
|
+
"frozen": True,
|
|
189
|
+
"use_enum_values": True,
|
|
190
|
+
"extra": "forbid",
|
|
191
|
+
"arbitrary_types_allowed": True,
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@classmethod
|
|
195
|
+
@functools.lru_cache(maxsize=100)
|
|
196
|
+
def create(cls, url: HttpUrl) -> "GitURL":
|
|
197
|
+
"""Create a GitURL object from a string URL."""
|
|
198
|
+
return cls(url=url)
|
|
199
|
+
|
|
200
|
+
@field_validator("url")
|
|
201
|
+
@classmethod
|
|
202
|
+
def validate_url(cls, v: HttpUrl) -> HttpUrl:
|
|
203
|
+
"""Validates the Git repository URL."""
|
|
204
|
+
try:
|
|
205
|
+
parse_git_url(str(v))
|
|
206
|
+
except ValueError as e:
|
|
207
|
+
raise ValueError(f"Invalid Git repository URL: {v}") from e
|
|
208
|
+
return v
|
|
209
|
+
|
|
210
|
+
@model_validator(mode="after")
|
|
211
|
+
def set_attributes(self) -> "GitURL":
|
|
212
|
+
"""Sets the Git URL attributes based on the URL."""
|
|
213
|
+
try:
|
|
214
|
+
host_domain, host, name, full_name = parse_git_url(str(self.url))
|
|
215
|
+
object.__setattr__(self, "host_domain", host_domain)
|
|
216
|
+
object.__setattr__(self, "name", name)
|
|
217
|
+
object.__setattr__(self, "full_name", full_name)
|
|
218
|
+
for git_host in GitHost:
|
|
219
|
+
if git_host.name.lower() == host:
|
|
220
|
+
object.__setattr__(self, "host", git_host)
|
|
221
|
+
break
|
|
222
|
+
except ValueError as e:
|
|
223
|
+
raise ValueError(f"Failed to parse Git URL: {self.url}") from e
|
|
224
|
+
return self
|
|
225
|
+
|
|
226
|
+
def get_api_url(self) -> str:
|
|
227
|
+
"""Return the REST API endpoint URL for a git repository."""
|
|
228
|
+
if self.host is None:
|
|
229
|
+
raise ValueError(
|
|
230
|
+
f"Unsupported Git host or local repository: {self.url}",
|
|
231
|
+
)
|
|
232
|
+
if self.full_name:
|
|
233
|
+
return f"{self.host.api_url}{self.full_name}"
|
|
234
|
+
else:
|
|
235
|
+
raise ValueError("Repository full name is required.")
|
|
236
|
+
|
|
237
|
+
def get_file_url(self, file_path: str) -> str:
|
|
238
|
+
"""Return the URL of the file in the remote repository."""
|
|
239
|
+
if self.host:
|
|
240
|
+
return self.host.file_url_template.format(
|
|
241
|
+
full_name=self.full_name,
|
|
242
|
+
file_path=file_path,
|
|
243
|
+
)
|
|
244
|
+
raise ValueError(f"Unsupported Git host: {self.url}")
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def parse_git_url(url: str | Path) -> tuple[str, str, str, str]:
|
|
248
|
+
"""Parse repository URL and return host, full name, and project name."""
|
|
249
|
+
try:
|
|
250
|
+
parsed_url = HttpUrl(url)
|
|
251
|
+
if parsed_url.scheme not in ["http", "https"]:
|
|
252
|
+
raise GitURLError(
|
|
253
|
+
url,
|
|
254
|
+
f"Unknown scheme provided: {parsed_url.scheme}",
|
|
255
|
+
)
|
|
256
|
+
except ValueError as e:
|
|
257
|
+
raise GitURLError(url) from e
|
|
258
|
+
|
|
259
|
+
assert (
|
|
260
|
+
parsed_url.host and parsed_url.path
|
|
261
|
+
), f"Invalid Git repository URL: {parsed_url}"
|
|
262
|
+
|
|
263
|
+
path_parts = parsed_url.path.strip("/").split("/")
|
|
264
|
+
|
|
265
|
+
full_name = "/".join(path_parts[:2])
|
|
266
|
+
|
|
267
|
+
host = parsed_url.host.split(".")[0].lower()
|
|
268
|
+
|
|
269
|
+
host_domain = parsed_url.host
|
|
270
|
+
|
|
271
|
+
name = path_parts[-1]
|
|
272
|
+
|
|
273
|
+
return host_domain, host, name, full_name
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_cli_args():
|
|
5
|
+
# Create a command line argument parser
|
|
6
|
+
parser = argparse.ArgumentParser(
|
|
7
|
+
description="Generate README.md for a GitHub repository",
|
|
8
|
+
formatter_class=argparse.RawTextHelpFormatter,
|
|
9
|
+
)
|
|
10
|
+
parser.add_argument(
|
|
11
|
+
"-r",
|
|
12
|
+
"--repository",
|
|
13
|
+
type=str,
|
|
14
|
+
help="URL of the GitHub repository",
|
|
15
|
+
required=True,
|
|
16
|
+
)
|
|
17
|
+
parser.add_argument(
|
|
18
|
+
"--api",
|
|
19
|
+
type=str,
|
|
20
|
+
help="LLM API service provider",
|
|
21
|
+
nargs="?",
|
|
22
|
+
choices=["llama", "openai"],
|
|
23
|
+
default="llama",
|
|
24
|
+
)
|
|
25
|
+
parser.add_argument(
|
|
26
|
+
"--base-url",
|
|
27
|
+
type=str,
|
|
28
|
+
help="URL of the provider compatible with API OpenAI",
|
|
29
|
+
nargs="?",
|
|
30
|
+
default="https://api.openai.com/v1",
|
|
31
|
+
)
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
"--model",
|
|
34
|
+
type=str,
|
|
35
|
+
help=(
|
|
36
|
+
"Specific LLM model to use. "
|
|
37
|
+
"To see available models go there:\n"
|
|
38
|
+
"1. https://vsegpt.ru/Docs/Models\n"
|
|
39
|
+
"2. https://platform.openai.com/docs/models"
|
|
40
|
+
),
|
|
41
|
+
nargs="?",
|
|
42
|
+
default="gpt-3.5-turbo",
|
|
43
|
+
)
|
|
44
|
+
parser.add_argument(
|
|
45
|
+
"--article",
|
|
46
|
+
type=str,
|
|
47
|
+
help=(
|
|
48
|
+
"Select a README template for a repository with an article.\n"
|
|
49
|
+
"You can also provide a link to the pdf file of the article\n"
|
|
50
|
+
"after the --article option."
|
|
51
|
+
),
|
|
52
|
+
nargs="?",
|
|
53
|
+
const="",
|
|
54
|
+
default=None,
|
|
55
|
+
)
|
|
56
|
+
parser.add_argument(
|
|
57
|
+
"--translate-dirs",
|
|
58
|
+
action="store_true",
|
|
59
|
+
help=(
|
|
60
|
+
"Enable automatic translation of the directory name into English.")
|
|
61
|
+
)
|
|
62
|
+
return parser.parse_args()
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Default API Settings
|
|
2
|
+
[api]
|
|
3
|
+
rate_limit = 10
|
|
4
|
+
system_message = "You're a brilliant Tech Lead and Staff Software Engineer with a passion for open-source projects."
|
|
5
|
+
|
|
6
|
+
# File Resources
|
|
7
|
+
[files]
|
|
8
|
+
docs_list = "docs_list.toml"
|
|
9
|
+
ignore_list = "ignore_list.toml"
|
|
10
|
+
languages = "languages.toml"
|
|
11
|
+
parsers = "parsers.toml"
|
|
12
|
+
prompts = "prompts.toml"
|
|
13
|
+
tool_config = "tool_config.toml"
|
|
14
|
+
tooling = "tooling.toml"
|
|
15
|
+
shieldsio_icons = "shieldsio_icons.json"
|
|
16
|
+
skill_icons = "skill_icons.json"
|
|
17
|
+
|
|
18
|
+
# Git Repository Settings
|
|
19
|
+
[git]
|
|
20
|
+
repository = "https://github.com/aimclub/FEDOT"
|
|
21
|
+
|
|
22
|
+
# Language Model API Settings
|
|
23
|
+
[llm]
|
|
24
|
+
api = "openai"
|
|
25
|
+
url = "https://api.openai.com/v1"
|
|
26
|
+
context_window = 4096
|
|
27
|
+
encoder = "cl100k_base"
|
|
28
|
+
host_name = "https://api.openai.com/v1"
|
|
29
|
+
localhost = "http://localhost:11434/"
|
|
30
|
+
model = "gpt-3.5-turbo"
|
|
31
|
+
path = "generate"
|
|
32
|
+
temperature = 0.05
|
|
33
|
+
tokens = 4096
|
|
34
|
+
top_p = 0.95
|
|
35
|
+
|
|
36
|
+
# Logging Configuration
|
|
37
|
+
[log]
|
|
38
|
+
log_level = "info"
|
|
39
|
+
indent = 2
|
|
40
|
+
pad_event = 20
|
|
41
|
+
use_json = true
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# LLM prompts for various text generation tasks.
|
|
2
|
+
|
|
3
|
+
[prompts]
|
|
4
|
+
core_features = """Hello! Analyze the codebase for the project {0} and generate a numbered markdown list summarizing its key techincal features.
|
|
5
|
+
|
|
6
|
+
You will be provided with four pieces of information:
|
|
7
|
+
1. PROJECT NAME: {0}
|
|
8
|
+
2. DEPENDENCIES: {1}
|
|
9
|
+
3. DOCUMENTATION: {2}
|
|
10
|
+
4. FILE CONTENTS: {3}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
To complete this task, follow these steps:
|
|
14
|
+
1. Carefully review all the information about the project to understand the key features of the project.
|
|
15
|
+
2. Craft an enumerated list with a brief description of the project's features.
|
|
16
|
+
|
|
17
|
+
Your response should adhere to the following guidelines:
|
|
18
|
+
- The list should contain up to 5 items.
|
|
19
|
+
- Limit your response for each line of the list to 15 words.
|
|
20
|
+
- Start each feature description on a new line.
|
|
21
|
+
|
|
22
|
+
Present your final list of core_features within <core_features> tags. Here's an example of a well-structured response:
|
|
23
|
+
|
|
24
|
+
<example>
|
|
25
|
+
<core_features>
|
|
26
|
+
|
|
27
|
+
1. **Feature 1**: Brief description.
|
|
28
|
+
|
|
29
|
+
2. **Feature 2**: Brief description.
|
|
30
|
+
|
|
31
|
+
3. **Feature 3**: Brief description.
|
|
32
|
+
|
|
33
|
+
4. **Feature 4**: Brief description.
|
|
34
|
+
|
|
35
|
+
5. **Feature 5**: Brief description.
|
|
36
|
+
|
|
37
|
+
</core_features>
|
|
38
|
+
</example>
|
|
39
|
+
|
|
40
|
+
Now, please, analyze the provided project information and generate a concise numbered list following the guidelines above.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
file_summary = """Deliver a succinct summary that highlights the main purpose and \
|
|
44
|
+
use of the code files provided in regards to the entire codebase architecture. Focus \
|
|
45
|
+
on what the code achieves, steering clear of technical implementation details. \
|
|
46
|
+
While generating the summary, reference additional data about the project below: \n
|
|
47
|
+
|
|
48
|
+
CONTEXT DETAILS:
|
|
49
|
+
------------------------
|
|
50
|
+
FILES CONTENT: {0}
|
|
51
|
+
------------------------
|
|
52
|
+
|
|
53
|
+
ADDITIONAL INSTRUCTIONS:
|
|
54
|
+
------------------------
|
|
55
|
+
1. Avoid using words like 'This file', 'The file', 'This code', etc.
|
|
56
|
+
1a. Summary should start with a verb or noun to make it more clear and concise.
|
|
57
|
+
2. Do not include quotes, code snippets, bullets, or lists in your response.
|
|
58
|
+
3. RESPONSE LENGTH: 200-250 words.
|
|
59
|
+
------------------------
|
|
60
|
+
|
|
61
|
+
Thank you for your hard work!
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
overview = """
|
|
65
|
+
You are tasked with analyzing a codebase and providing a concise overview of the software project. Your goal is to create a brief paragraph that captures the project's core use-case, value proposition, and target audience without delving into technical details.
|
|
66
|
+
|
|
67
|
+
You will be provided with two pieces of information:
|
|
68
|
+
1. PROJECT NAME: {0}
|
|
69
|
+
2. SUMMARY OF PROJECT'S FILES: {1}
|
|
70
|
+
|
|
71
|
+
To complete this task, follow these steps:
|
|
72
|
+
1. Carefully review the project name and file summaries to understand the project's purpose and structure.
|
|
73
|
+
2. Identify the core use-case, value proposition, and target audience based on the information provided.
|
|
74
|
+
3. Craft a concise paragraph that elegantly presents these key aspects of the project.
|
|
75
|
+
|
|
76
|
+
Your response should adhere to the following guidelines:
|
|
77
|
+
- Focus on the project's core use-case and value proposition without including technical details.
|
|
78
|
+
- Exclude technical jargon, code snippets, implementation specifics, quotes, and links.
|
|
79
|
+
- Limit your response to a maximum of 60 words.
|
|
80
|
+
|
|
81
|
+
Present your final overview within <overview> tags. Here's an example of a well-structured response:
|
|
82
|
+
|
|
83
|
+
<example>
|
|
84
|
+
<overview>
|
|
85
|
+
README-AI is a developer tool that automatically generates comprehensive README files for software projects. It streamlines documentation creation across all technical disciplines, offering customization options and supporting multiple languages. This tool aims to improve consistency and efficiency in project documentation for developers of all experience levels.
|
|
86
|
+
</overview>
|
|
87
|
+
</example>
|
|
88
|
+
|
|
89
|
+
Now, please, analyze the provided project information and generate a concise overview following the guidelines above.
|
|
90
|
+
"""
|
|
91
|
+
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Markdown Configuration
|
|
2
|
+
[md]
|
|
3
|
+
badges_tech_stack_text = "Built with the tools and technologies:"
|
|
4
|
+
badges_tech_stack = """{badges_tech_stack}"""
|
|
5
|
+
github_stats = """
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
shieldsio_icons = """
|
|
15
|
+
<a href="https://itmo.ru/"><img src="https://raw.githubusercontent.com/aimclub/open-source-ops/43bb283758b43d75ec1df0a6bb4ae3eb20066323/badges/ITMO_badge.svg"></a>
|
|
16
|
+
\t<img src="https://img.shields.io/{host}/license/{full_name}?style={badge_style}&logo=opensourceinitiative&logoColor=white&color={badge_color}" alt="license">
|
|
17
|
+
\t<a href="https://github.com/ITMO-NSS-team/Open-Source-Advisor"><img src="https://img.shields.io/badge/improved%20by-OSA-blue"></a>
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
skill_icons = """<a href="https://skillicons.dev">\n\t\t<img src="{}">\n\t</a>"""
|
|
21
|
+
|
|
22
|
+
# -- Overview Section ----------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
overview = """
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
## Overview
|
|
28
|
+
|
|
29
|
+
{0}
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
# -- ToC Section ---------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
table_of_contents = """
|
|
37
|
+
|
|
38
|
+
## Table of contents
|
|
39
|
+
|
|
40
|
+
- [Core features](#core-features)
|
|
41
|
+
- [Installation](#installation)
|
|
42
|
+
- [Examples](#examples)
|
|
43
|
+
- [Documentation](#documentation)
|
|
44
|
+
- [Getting started](#getting-started)
|
|
45
|
+
- [Contributing](#contributing)
|
|
46
|
+
- [License](#license)
|
|
47
|
+
- [Acknowledgments](#acknowledgments)
|
|
48
|
+
- [Contacts](#contacts)
|
|
49
|
+
- [Citation](#citation)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
# -- Core Features Section ------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
core_features = """
|
|
57
|
+
## Core features
|
|
58
|
+
|
|
59
|
+
{0}
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
# -- Examples Section ---------------------------------------------------------------
|
|
65
|
+
|
|
66
|
+
examples = """
|
|
67
|
+
|
|
68
|
+
## Examples
|
|
69
|
+
|
|
70
|
+
Examples of how this should work and how it should be used are available in [{examples}](https://{host_domain}/{full_name}/tree/{default_branch}/{examples_path}).
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
# -- Docs Section ---------------------------------------------------------------
|
|
76
|
+
documentation = """
|
|
77
|
+
|
|
78
|
+
## Documentation
|
|
79
|
+
|
|
80
|
+
A detailed {repo_name} description is available in [{docs}]({homepage_url}).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
# -- Acknowledgments Section ---------------------------------------------------
|
|
86
|
+
|
|
87
|
+
acknowledgments = """
|
|
88
|
+
|
|
89
|
+
## Acknowledgments
|
|
90
|
+
|
|
91
|
+
- List any resources, contributors, inspiration, etc. here.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
# -- License Section -----------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
license = """
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
This project is protected under the {license_name}. For more details, refer to the [LICENSE](https://{host_domain}/{full_name}/blob/{default_branch}/{license_path}) file.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
# -- Contact Section -----------------------------------------------------------
|
|
109
|
+
|
|
110
|
+
contacts = """
|
|
111
|
+
|
|
112
|
+
## Contacts
|
|
113
|
+
|
|
114
|
+
Your contacts. For example:
|
|
115
|
+
|
|
116
|
+
- [Telegram channel](https://t.me/) answering questions about your project
|
|
117
|
+
- [VK group](<https://vk.com/>) your VK group
|
|
118
|
+
- etc.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
# -- Citation Section ----------------------------------------------------------
|
|
125
|
+
|
|
126
|
+
citation = """
|
|
127
|
+
## Citation
|
|
128
|
+
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
citation_v1 = """
|
|
132
|
+
If you use this software, please cite it as it is written in the [CITATION](https://{host_domain}/{full_name}/blob/{default_branch}/{citation_path}) file.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
citation_v2 = """
|
|
138
|
+
If you use this software, please cite it as below.
|
|
139
|
+
|
|
140
|
+
### APA format:
|
|
141
|
+
|
|
142
|
+
{owner} ({year}). {repo_name} repository [Computer software]. {repository_url}
|
|
143
|
+
|
|
144
|
+
### BibTeX format:
|
|
145
|
+
|
|
146
|
+
@misc{{{repo_name},
|
|
147
|
+
|
|
148
|
+
author = {{{owner}}},
|
|
149
|
+
|
|
150
|
+
title = {{{repo_name} repository}},
|
|
151
|
+
|
|
152
|
+
year = {{{year}}},
|
|
153
|
+
|
|
154
|
+
publisher = {{{publisher}}},
|
|
155
|
+
|
|
156
|
+
journal = {{{publisher} repository}},
|
|
157
|
+
|
|
158
|
+
howpublished = {{\\url{{{repository_url}.git}}}},
|
|
159
|
+
|
|
160
|
+
url = {{{repository_url}.git}}
|
|
161
|
+
|
|
162
|
+
}}
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
"""
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Default API Settings
|
|
2
|
+
[api]
|
|
3
|
+
rate_limit = 10
|
|
4
|
+
system_message = "You're a brilliant Tech Lead and Staff Software Engineer with a passion for open-source projects."
|
|
5
|
+
|
|
6
|
+
# File Resources
|
|
7
|
+
[files]
|
|
8
|
+
docs_list = "docs_list.toml"
|
|
9
|
+
ignore_list = "ignore_list.toml"
|
|
10
|
+
languages = "languages.toml"
|
|
11
|
+
parsers = "parsers.toml"
|
|
12
|
+
prompts = "prompts.toml"
|
|
13
|
+
tool_config = "tool_config.toml"
|
|
14
|
+
tooling = "tooling.toml"
|
|
15
|
+
shieldsio_icons = "shieldsio_icons.json"
|
|
16
|
+
skill_icons = "skill_icons.json"
|
|
17
|
+
|
|
18
|
+
# Git Repository Settings
|
|
19
|
+
[git]
|
|
20
|
+
repository = "https://github.com/aimclub/FEDOT"
|
|
21
|
+
|
|
22
|
+
# Language Model API Settings
|
|
23
|
+
[llm]
|
|
24
|
+
api = "llama"
|
|
25
|
+
url = "http://10.32.15.21:6672/generate"
|
|
26
|
+
context_window = 4096
|
|
27
|
+
encoder = "cl100k_base"
|
|
28
|
+
host_name = "http://10.32.15.21:6672/"
|
|
29
|
+
localhost = "http://localhost:11434/"
|
|
30
|
+
model = "llama"
|
|
31
|
+
path = "generate"
|
|
32
|
+
temperature = 0.05
|
|
33
|
+
tokens = 4096
|
|
34
|
+
top_p = 0.95
|
|
35
|
+
|
|
36
|
+
# Logging Configuration
|
|
37
|
+
[log]
|
|
38
|
+
log_level = "info"
|
|
39
|
+
indent = 2
|
|
40
|
+
pad_event = 20
|
|
41
|
+
use_json = true
|