uis-sprint-report 0.1.4__tar.gz → 0.1.5__tar.gz
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.
Potentially problematic release.
This version of uis-sprint-report might be problematic. Click here for more details.
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/PKG-INFO +1 -1
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/demo/demo.py +90 -1
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/demo/embeddings.py +27 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/demo/main.py +28 -0
- uis-sprint-report-0.1.5/demo/models.py +50 -0
- uis-sprint-report-0.1.5/demo/utils.py +67 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/setup.py +1 -1
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/PKG-INFO +1 -1
- uis-sprint-report-0.1.4/demo/models.py +0 -16
- uis-sprint-report-0.1.4/demo/utils.py +0 -33
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/LICENSE +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/README.md +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/demo/__init__.py +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/demo/config.py +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/demo/prompts.py +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/setup.cfg +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/tests/__init__.py +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/tests/test_demo.py +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/tests/test_embeddings.py +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/tests/test_utils.py +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/SOURCES.txt +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/dependency_links.txt +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/entry_points.txt +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/requires.txt +0 -0
- {uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uis-sprint-report
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: A Python package for generating sprint reports and managing sprint activities at University Information Services.
|
|
5
5
|
Home-page: https://gitlab.developers.cam.ac.uk/ee345/demo
|
|
6
6
|
Author: Eugene Evstafev
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module integrates language model processing with sprint report generation and interaction,
|
|
3
|
+
utilizing data from GitLab and structuring outputs in various formats including JSON, tables,
|
|
4
|
+
and PowerPoint presentations. It primarily uses the langchain library to structure and parse
|
|
5
|
+
outputs and the rich library to enhance command-line interface outputs.
|
|
6
|
+
"""
|
|
1
7
|
import os
|
|
2
8
|
from rich import print
|
|
3
9
|
from rich.table import Table
|
|
@@ -12,7 +18,15 @@ from .models import SprintReport, ResponseModel
|
|
|
12
18
|
|
|
13
19
|
|
|
14
20
|
def prepare_parser_and_prompt(model):
|
|
15
|
-
"""
|
|
21
|
+
"""
|
|
22
|
+
Prepares a parser and prompt template for use in generating structured outputs based on a specified model.
|
|
23
|
+
|
|
24
|
+
Parameters:
|
|
25
|
+
model (BaseModel): A Pydantic model that defines the schema for output data.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
tuple: A tuple containing the configured parser and prompt template.
|
|
29
|
+
"""
|
|
16
30
|
parser = PydanticOutputParser(pydantic_object=model)
|
|
17
31
|
prompt_template = ChatPromptTemplate.from_messages([
|
|
18
32
|
("system",
|
|
@@ -24,11 +38,33 @@ def prepare_parser_and_prompt(model):
|
|
|
24
38
|
|
|
25
39
|
|
|
26
40
|
def prepare_chain(llm, retriever, model):
|
|
41
|
+
"""
|
|
42
|
+
Prepares the entire processing chain from prompt preparation to response parsing.
|
|
43
|
+
|
|
44
|
+
Parameters:
|
|
45
|
+
llm (ChatOllama): The language model used for generating responses.
|
|
46
|
+
retriever (any): The retriever instance used to fetch context.
|
|
47
|
+
model (BaseModel): The model specifying output schema.
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
Pipeline: A fully configured pipeline ready for invoking with user queries.
|
|
51
|
+
"""
|
|
27
52
|
parser, prompt_template = prepare_parser_and_prompt(model)
|
|
28
53
|
return {"context": retriever, "query": RunnablePassthrough()} | prompt_template | llm | parser
|
|
29
54
|
|
|
30
55
|
|
|
31
56
|
def invoke_chain(chain, prompt, max_attempts):
|
|
57
|
+
"""
|
|
58
|
+
Invokes the processing chain with retries on failure up to a maximum number of attempts.
|
|
59
|
+
|
|
60
|
+
Parameters:
|
|
61
|
+
chain (Pipeline): The processing chain to be invoked.
|
|
62
|
+
prompt (str): The user query to be processed.
|
|
63
|
+
max_attempts (int): Maximum number of retry attempts.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Any: The result from the processing chain or an error message after max attempts.
|
|
67
|
+
"""
|
|
32
68
|
count_attempts = 0
|
|
33
69
|
while count_attempts < max_attempts:
|
|
34
70
|
try:
|
|
@@ -40,6 +76,18 @@ def invoke_chain(chain, prompt, max_attempts):
|
|
|
40
76
|
|
|
41
77
|
|
|
42
78
|
def get_report(llm, embeddings, max_attempts, sprint_goals=None):
|
|
79
|
+
"""
|
|
80
|
+
Generates a structured report based on sprint goals and activities data.
|
|
81
|
+
|
|
82
|
+
Parameters:
|
|
83
|
+
llm (ChatOllama): Language model used for data processing.
|
|
84
|
+
embeddings (any): Data retriever containing sprint activity embeddings.
|
|
85
|
+
max_attempts (int): Maximum number of attempts for generating the report.
|
|
86
|
+
sprint_goals (str, optional): Additional sprint goals to be appended in the report.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
Any: Structured report containing sprint activities and statuses.
|
|
90
|
+
"""
|
|
43
91
|
chain = prepare_chain(llm, embeddings, SprintReport)
|
|
44
92
|
prompt = prompts['generate_report']['question']
|
|
45
93
|
if sprint_goals is not None:
|
|
@@ -49,6 +97,14 @@ def get_report(llm, embeddings, max_attempts, sprint_goals=None):
|
|
|
49
97
|
|
|
50
98
|
|
|
51
99
|
def report(llm, embeddings, max_attempts):
|
|
100
|
+
"""
|
|
101
|
+
Prints a sprint report in a rich formatted table.
|
|
102
|
+
|
|
103
|
+
Parameters:
|
|
104
|
+
llm (ChatOllama): Language model for processing.
|
|
105
|
+
embeddings (any): Embeddings of sprint data.
|
|
106
|
+
max_attempts (int): Maximum number of attempts for generating the report.
|
|
107
|
+
"""
|
|
52
108
|
print("[bold]Generating report...[/bold]")
|
|
53
109
|
report = get_report(llm, embeddings, max_attempts)
|
|
54
110
|
|
|
@@ -70,6 +126,16 @@ def report(llm, embeddings, max_attempts):
|
|
|
70
126
|
|
|
71
127
|
|
|
72
128
|
def pptx(llm, embeddings, max_attempts, sprint_goals, pptx_file_name):
|
|
129
|
+
"""
|
|
130
|
+
Generates a PowerPoint presentation from sprint report data.
|
|
131
|
+
|
|
132
|
+
Parameters:
|
|
133
|
+
llm (ChatOllama): Language model used for generating the report.
|
|
134
|
+
embeddings (any): Embeddings containing sprint data.
|
|
135
|
+
max_attempts (int): Maximum number of attempts for data retrieval.
|
|
136
|
+
sprint_goals (str): Sprint goals to include in the report.
|
|
137
|
+
pptx_file_name (str): File name for the generated PowerPoint presentation.
|
|
138
|
+
"""
|
|
73
139
|
report = get_report(llm, embeddings, max_attempts, sprint_goals)
|
|
74
140
|
|
|
75
141
|
prs = Presentation()
|
|
@@ -91,6 +157,14 @@ def pptx(llm, embeddings, max_attempts, sprint_goals, pptx_file_name):
|
|
|
91
157
|
|
|
92
158
|
|
|
93
159
|
def chat(llm, embeddings, max_attempts):
|
|
160
|
+
"""
|
|
161
|
+
Conducts a chat session where users can interactively query sprint status.
|
|
162
|
+
|
|
163
|
+
Parameters:
|
|
164
|
+
llm (ChatOllama): Language model for processing chat queries.
|
|
165
|
+
embeddings (any): Data retriever for sprint activities.
|
|
166
|
+
max_attempts (int): Maximum number of attempts for responding to each query.
|
|
167
|
+
"""
|
|
94
168
|
is_end = False
|
|
95
169
|
while not is_end:
|
|
96
170
|
user_input = input("You: ")
|
|
@@ -108,6 +182,21 @@ def chat(llm, embeddings, max_attempts):
|
|
|
108
182
|
|
|
109
183
|
|
|
110
184
|
def execute_command(command, embeddings, model, max_tokens, max_attempts, sprint_goals, pptx_file_name):
|
|
185
|
+
"""
|
|
186
|
+
Executes the specified command using the provided model and data.
|
|
187
|
+
|
|
188
|
+
Parameters:
|
|
189
|
+
command (str): The command to execute ('report', 'pptx', or 'chat').
|
|
190
|
+
embeddings (any): Embeddings containing sprint data.
|
|
191
|
+
model (str): Model identifier for the language model.
|
|
192
|
+
max_tokens (int): Maximum number of tokens the model can handle.
|
|
193
|
+
max_attempts (int): Maximum number of attempts for command execution.
|
|
194
|
+
sprint_goals (str): Sprint goals to be included where applicable.
|
|
195
|
+
pptx_file_name (str): Filename for storing PowerPoint presentations.
|
|
196
|
+
|
|
197
|
+
Raises:
|
|
198
|
+
Exception: If an invalid command is specified.
|
|
199
|
+
"""
|
|
111
200
|
llm = ChatOllama(model=model, max_tokens=max_tokens)
|
|
112
201
|
if command == "report":
|
|
113
202
|
report(llm, embeddings, max_attempts)
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module handles the retrieval of issues from GitLab and generates embeddings from the issue
|
|
3
|
+
descriptions for sprint reporting. It uses the langchain library to create vector embeddings that
|
|
4
|
+
can be used to retrieve similar texts or perform further analysis.
|
|
5
|
+
"""
|
|
1
6
|
from rich import print
|
|
2
7
|
from .utils import manage_cache_file
|
|
3
8
|
from get_gitlab_issues import get_gitlab_issues, get_gitlab_issue
|
|
@@ -19,6 +24,28 @@ def generate_embeddings(
|
|
|
19
24
|
embedding_model,
|
|
20
25
|
sprint_goals
|
|
21
26
|
):
|
|
27
|
+
"""
|
|
28
|
+
Retrieves issues from GitLab and generates text embeddings.
|
|
29
|
+
|
|
30
|
+
This function fetches issues based on provided filters, extracts text, and uses the specified
|
|
31
|
+
embedding model to generate vector embeddings that can be used for text retrieval.
|
|
32
|
+
|
|
33
|
+
Parameters:
|
|
34
|
+
api_base (str): The base URL for the GitLab API.
|
|
35
|
+
access_token (str): Token for API authentication.
|
|
36
|
+
labels (str): Labels to filter the issues.
|
|
37
|
+
group_id (int): GitLab group ID to fetch issues from.
|
|
38
|
+
iteration_id (int): Specific iteration ID for issue retrieval.
|
|
39
|
+
cache_file (str): Path to the cache file for storing and retrieving issue data.
|
|
40
|
+
chunk_size (int): Size of text chunks for processing.
|
|
41
|
+
chunk_overlap (int): Overlap between consecutive text chunks.
|
|
42
|
+
embedding_model (any): Model used to generate embeddings.
|
|
43
|
+
sprint_goals (str): Description of sprint goals to include in the cache.
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
FAISS.Retriever: A retriever object that can be used to fetch similar text based on the
|
|
47
|
+
embeddings generated.
|
|
48
|
+
"""
|
|
22
49
|
print("[green]Recieveing issues from GitLab...[/green]")
|
|
23
50
|
issues = get_gitlab_issues(access_token, api_base, group_id, labels, iteration_id)
|
|
24
51
|
board = []
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module defines the command-line interface for the UIS Sprint Report tool. It allows users to generate sprint
|
|
3
|
+
reports, create PowerPoint presentations based on sprint activities, and interact with the sprint data
|
|
4
|
+
via a chat interface.
|
|
5
|
+
The tool integrates with GitLab to fetch issues and uses the Ollama model for processing data.
|
|
6
|
+
|
|
7
|
+
The module sets up the CLI with various options to specify details like API base URL, access token, commands,
|
|
8
|
+
and other necessary parameters to control the behavior of the report generation and interaction processes.
|
|
9
|
+
"""
|
|
1
10
|
import click
|
|
2
11
|
from .utils import check_gitlab_credentials, check_ollama
|
|
3
12
|
from .embeddings import generate_embeddings
|
|
@@ -51,6 +60,25 @@ def demo(
|
|
|
51
60
|
pptx_file: str,
|
|
52
61
|
max_attempts: int
|
|
53
62
|
):
|
|
63
|
+
"""
|
|
64
|
+
Executes the specified command with the provided parameters to interact with GitLab issues, generate reports,
|
|
65
|
+
and manage sprint activities.
|
|
66
|
+
|
|
67
|
+
:param api_base: The base URL for the GitLab API.
|
|
68
|
+
:param access_token: The access token for GitLab API authentication.
|
|
69
|
+
:param model: The name of the Ollama model to use.
|
|
70
|
+
:param command: The command to execute ('report', 'pptx', 'chat').
|
|
71
|
+
:param labels: Labels used to filter issues in GitLab.
|
|
72
|
+
:param iteration_id: Specific iteration ID for issue retrieval.
|
|
73
|
+
:param group_id: GitLab group ID from which to retrieve issues.
|
|
74
|
+
:param cache_file: Path to cache file for storing retrieved data.
|
|
75
|
+
:param chunk_size: Size of text chunks for processing.
|
|
76
|
+
:param chunk_overlap: Overlap between text chunks.
|
|
77
|
+
:param max_tokens: Max number of tokens the model can handle.
|
|
78
|
+
:param sprint_goals: Goals of the sprint to be included in the report.
|
|
79
|
+
:param pptx_file: Path to save the generated PowerPoint file.
|
|
80
|
+
:param max_attempts: Max attempts for generating outputs.
|
|
81
|
+
"""
|
|
54
82
|
check_gitlab_credentials(access_token, api_base)
|
|
55
83
|
check_ollama(model)
|
|
56
84
|
embedding_model = HuggingFaceEmbeddings()
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module defines data models using Pydantic for structured data representation and validation
|
|
3
|
+
within the UIS Sprint Report application. These models are essential for ensuring that data
|
|
4
|
+
conforms to expected formats throughout the application's logic, especially when generating,
|
|
5
|
+
processing, and responding to sprint-related data.
|
|
6
|
+
|
|
7
|
+
Classes:
|
|
8
|
+
- Activity: Represents an individual sprint activity, detailing its current status and description.
|
|
9
|
+
- SprintReport: Aggregates multiple activities into a single report format.
|
|
10
|
+
- ResponseModel: Formats responses to user queries for consistent interaction.
|
|
11
|
+
"""
|
|
12
|
+
from langchain_core.pydantic_v1 import BaseModel, Field
|
|
13
|
+
from typing import List
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Activity(BaseModel):
|
|
17
|
+
"""
|
|
18
|
+
Represents a single activity within a sprint, providing a structured format for maintaining
|
|
19
|
+
the title, brief description, and current status of the activity.
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
title (str): Summarizes the main goal or purpose of the activity.
|
|
23
|
+
brief_desc_status (str): Provides a concise description of the activity's current status.
|
|
24
|
+
status (str): Indicates the current progress status of the activity (e.g., 'Planned', 'InProgress', 'Completed').
|
|
25
|
+
"""
|
|
26
|
+
title: str = Field(..., description="The title of the activity, summarizing the main goal or purpose of the activity.")
|
|
27
|
+
brief_desc_status: str = Field(..., description="A short and concise description of the status activity, summarizing its main status.")
|
|
28
|
+
status: str = Field(..., description="The current status of the activity, indicating its progress such as 'Planned', 'InProgress', or 'Completed'.")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class SprintReport(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Aggregates multiple activities into a structured sprint report, suitable for generating
|
|
34
|
+
detailed overviews of sprint progress.
|
|
35
|
+
|
|
36
|
+
Attributes:
|
|
37
|
+
activities (List[Activity]): A list of activities, each represented by an `Activity` instance.
|
|
38
|
+
"""
|
|
39
|
+
activities: List[Activity] = Field(..., description="A list of main activities, each described with a title, brief description status, and current status, summarizing the sprint's progress.")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class ResponseModel(BaseModel):
|
|
43
|
+
"""
|
|
44
|
+
Provides a structured format for responses to user queries, ensuring consistency across
|
|
45
|
+
different parts of the application when communicating results or statuses to users.
|
|
46
|
+
|
|
47
|
+
Attributes:
|
|
48
|
+
response (str): The actual text response provided to the user, encapsulating the answer or information requested.
|
|
49
|
+
"""
|
|
50
|
+
response: str = Field(..., description="The response to the user query, providing the requested information.")
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Utility functions to support the operation of the UIS Sprint Report tool. Includes functions to verify
|
|
3
|
+
GitLab credentials, check the availability of the Ollama model, and manage local cache files.
|
|
4
|
+
|
|
5
|
+
These functions enhance the robustness of the tool by ensuring all configurations and dependencies
|
|
6
|
+
are correctly set up before performing main operations.
|
|
7
|
+
"""
|
|
8
|
+
import os
|
|
9
|
+
import ollama
|
|
10
|
+
from rich import print
|
|
11
|
+
from get_gitlab_issues import check_access
|
|
12
|
+
from .config import CACHE_FILE
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def check_gitlab_credentials(token, url):
|
|
16
|
+
"""
|
|
17
|
+
Validates GitLab API credentials by attempting an access check.
|
|
18
|
+
|
|
19
|
+
Parameters:
|
|
20
|
+
token (str): The GitLab access token.
|
|
21
|
+
url (str): The GitLab API URL.
|
|
22
|
+
|
|
23
|
+
Raises:
|
|
24
|
+
Exception: If the credentials are not valid.
|
|
25
|
+
"""
|
|
26
|
+
if not check_access(token, url):
|
|
27
|
+
print(f"[red]Invalid GitLab credentials[/red]")
|
|
28
|
+
raise Exception("Invalid GitLab credentials")
|
|
29
|
+
print("[green]GitLab credentials are valid[/green]")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def check_ollama(model=None):
|
|
33
|
+
"""
|
|
34
|
+
Verifies if a specified Ollama model is available and running.
|
|
35
|
+
|
|
36
|
+
Parameters:
|
|
37
|
+
model (str, optional): The name of the model to check. Defaults to None.
|
|
38
|
+
|
|
39
|
+
Raises:
|
|
40
|
+
Exception: If the Ollama model is not valid or the Ollama service is not running.
|
|
41
|
+
"""
|
|
42
|
+
try:
|
|
43
|
+
models = ollama.list()['models']
|
|
44
|
+
if models and not any(m['name'] == model for m in models):
|
|
45
|
+
print(f"[red]Invalid Ollama model[/red]")
|
|
46
|
+
raise Exception("Invalid Ollama model")
|
|
47
|
+
except Exception as e:
|
|
48
|
+
print(f"[red]Ollama is not running. Error: {e}[/red]")
|
|
49
|
+
raise Exception("Ollama is not running")
|
|
50
|
+
print("[green]Ollama model is valid[/green]")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def manage_cache_file(create=False, content=None):
|
|
54
|
+
"""
|
|
55
|
+
Manages a local cache file for storing or clearing temporary data.
|
|
56
|
+
|
|
57
|
+
Parameters:
|
|
58
|
+
create (bool): If True, creates a new cache file with the provided content. If False,
|
|
59
|
+
deletes the existing cache file.
|
|
60
|
+
content (str, optional): Data to write to the file when creating. Defaults to None.
|
|
61
|
+
"""
|
|
62
|
+
if create:
|
|
63
|
+
with open(CACHE_FILE, 'w') as f:
|
|
64
|
+
f.write(content)
|
|
65
|
+
else:
|
|
66
|
+
if os.path.exists(CACHE_FILE):
|
|
67
|
+
os.remove(CACHE_FILE)
|
|
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|
|
3
3
|
|
|
4
4
|
setup(
|
|
5
5
|
name='uis-sprint-report',
|
|
6
|
-
version='0.1.
|
|
6
|
+
version='0.1.5',
|
|
7
7
|
author='Eugene Evstafev',
|
|
8
8
|
author_email='ee345@cam.ac.uk',
|
|
9
9
|
description='A Python package for generating sprint reports and managing sprint activities at University Information Services.',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uis-sprint-report
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: A Python package for generating sprint reports and managing sprint activities at University Information Services.
|
|
5
5
|
Home-page: https://gitlab.developers.cam.ac.uk/ee345/demo
|
|
6
6
|
Author: Eugene Evstafev
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from langchain_core.pydantic_v1 import BaseModel, Field
|
|
2
|
-
from typing import List
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Activity(BaseModel):
|
|
6
|
-
title: str = Field(..., description="The title of the activity, summarizing the main goal or purpose of the activity.")
|
|
7
|
-
brief_desc_status: str = Field(..., description="A short and concise description of the status activity, summarizing its main status.")
|
|
8
|
-
status: str = Field(..., description="The current status of the activity, indicating its progress such as 'Planned', 'InProgress', or 'Completed'.")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class SprintReport(BaseModel):
|
|
12
|
-
activities: List[Activity] = Field(..., description="A list of main activities, each described with a title, brief description status, and current status, summarizing the sprint's progress.")
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ResponseModel(BaseModel):
|
|
16
|
-
response: str = Field(..., description="The response to the user query, providing the requested information.")
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import ollama
|
|
3
|
-
from rich import print
|
|
4
|
-
from get_gitlab_issues import check_access
|
|
5
|
-
from .config import CACHE_FILE
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def check_gitlab_credentials(token, url):
|
|
9
|
-
if not check_access(token, url):
|
|
10
|
-
print(f"[red]Invalid GitLab credentials[/red]")
|
|
11
|
-
raise Exception("Invalid GitLab credentials")
|
|
12
|
-
print("[green]GitLab credentials are valid[/green]")
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def check_ollama(model=None):
|
|
16
|
-
try:
|
|
17
|
-
models = ollama.list()['models']
|
|
18
|
-
if models and not any(m['name'] == model for m in models):
|
|
19
|
-
print(f"[red]Invalid Ollama model[/red]")
|
|
20
|
-
raise Exception("Invalid Ollama model")
|
|
21
|
-
except Exception as e:
|
|
22
|
-
print(f"[red]Ollama is not running. Error: {e}[/red]")
|
|
23
|
-
raise Exception("Ollama is not running")
|
|
24
|
-
print("[green]Ollama model is valid[/green]")
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def manage_cache_file(create=False, content=None):
|
|
28
|
-
if create:
|
|
29
|
-
with open(CACHE_FILE, 'w') as f:
|
|
30
|
-
f.write(content)
|
|
31
|
-
else:
|
|
32
|
-
if os.path.exists(CACHE_FILE):
|
|
33
|
-
os.remove(CACHE_FILE)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{uis-sprint-report-0.1.4 → uis-sprint-report-0.1.5}/uis_sprint_report.egg-info/top_level.txt
RENAMED
|
File without changes
|