Skip to content

Commit f149b9a

Browse files
committed
formating second attempt
1 parent 08fd195 commit f149b9a

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

supporting-blog-content/github-assistant/evaluation.py

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import textwrap
1616
import argparse
1717
import traceback
18-
from httpx import ReadTimeout
18+
from httpx import ReadTimeout
1919

2020
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
2121
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
@@ -24,33 +24,33 @@
2424
description="Process documents and questions for evaluation."
2525
)
2626
parser.add_argument(
27-
"--num_documents",
28-
type=int,
29-
default=None,
30-
help="Number of documents to process (default: all)"
27+
"--num_documents",
28+
type=int,
29+
default=None,
30+
help="Number of documents to process (default: all)"
3131
)
3232
parser.add_argument(
33-
"--skip_documents",
34-
type=int,
35-
default=0,
36-
help="Number of documents to skip at the beginning (default: 0)"
33+
"--skip_documents",
34+
type=int,
35+
default=0,
36+
help="Number of documents to skip at the beginning (default: 0)"
3737
)
3838
parser.add_argument(
39-
"--num_questions",
40-
type=int,
41-
default=None,
42-
help="Number of questions to process (default: all)"
39+
"--num_questions",
40+
type=int,
41+
default=None,
42+
help="Number of questions to process (default: all)"
4343
)
4444
parser.add_argument(
45-
"--skip_questions",
46-
type=int,
47-
default=0,
48-
help="Number of questions to skip at the beginning (default: 0)"
45+
"--skip_questions",
46+
type=int,
47+
default=0,
48+
help="Number of questions to skip at the beginning (default: 0)"
4949
)
5050
parser.add_argument(
51-
"--process_last_questions",
52-
action="store_true",
53-
help="Process last N questions instead of first N"
51+
"--process_last_questions",
52+
action="store_true",
53+
help="Process last N questions instead of first N"
5454
)
5555
args = parser.parse_args()
5656

@@ -117,6 +117,7 @@
117117

118118
vector_index = VectorStoreIndex.from_documents(documents)
119119

120+
120121
def display_eval_df(
121122
query: str,
122123
response: Response,
@@ -170,6 +171,7 @@ def wrap_text(text, width=50):
170171
)
171172
)
172173

174+
173175
query_engine = vector_index.as_query_engine(llm=llm)
174176

175177
total_questions = len(eval_questions_list)

supporting-blog-content/github-assistant/query.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
embed_model = OpenAIEmbedding(model="text-embedding-3-large")
99
Settings.embed_model = embed_model
1010

11+
1112
def run_query_sync():
1213
query = input("Please enter your query: ")
1314

@@ -43,6 +44,7 @@ def run_query_sync():
4344
es_vector_store.close()
4445
print("Elasticsearch connection closed.")
4546

47+
4648
if __name__ == "__main__":
4749
try:
4850
result = run_query_sync()

0 commit comments

Comments
 (0)