Skip to content

Commit 553e20e

Browse files
authored
Merge pull request #10 from metauto-ai/fix/bugs_in_ask_anything
fix the bugs mentioned by @lsm1103
2 parents 3b67ece + 03693f0 commit 553e20e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,9 @@ Dockerfile
170170

171171
# pycache
172172
*/__pycache__/
173+
174+
# Ignore all .env files in the repository
175+
.env
176+
177+
# Ignore all judge files
178+
*/judge/

agent_as_a_judge/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def judge_anything(self):
219219
def ask_anything(self, question: str):
220220

221221
workflow = ["workspace", "locate", "read", "search"]
222-
llm_stats, start_time = self.get_evidence(
222+
llm_stats, start_time = self.check_requirement(
223223
criteria=question, workflow=workflow, user_query=question
224224
)
225225
evidence = truncate_string(

agent_as_a_judge/utils/truncate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import os
12
import logging
23
from typing import Union
34
import tiktoken
5+
from dotenv import load_dotenv
46

7+
load_dotenv()
58

69
def truncate_string(
710
info_string: Union[str, None],
8-
model: str,
11+
model: str = os.getenv("DEFAULT_LLM"),
912
max_tokens: int = 10000,
1013
drop_mode="middle",
1114
) -> str:

0 commit comments

Comments
 (0)