bioguider 0.2.14__tar.gz → 0.2.15__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 bioguider might be problematic. Click here for more details.
- {bioguider-0.2.14 → bioguider-0.2.15}/PKG-INFO +1 -1
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/agent_task.py +2 -2
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/collection_observe_step.py +7 -2
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/collection_task.py +1 -1
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/collection_task_utils.py +1 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/identification_observe_step.py +7 -2
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/identification_task.py +4 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/identification_task_utils.py +2 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/prompt_utils.py +1 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/utils/constants.py +2 -1
- {bioguider-0.2.14 → bioguider-0.2.15}/pyproject.toml +1 -1
- {bioguider-0.2.14 → bioguider-0.2.15}/LICENSE +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/README.md +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/__init__.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/__init__.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/agent_tools.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/agent_utils.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/collection_execute_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/collection_plan_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/common_agent.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/common_agent_2step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/common_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/dockergeneration_execute_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/dockergeneration_observe_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/dockergeneration_plan_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/dockergeneration_task.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/dockergeneration_task_utils.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/evaluation_installation_task.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/evaluation_readme_task.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/evaluation_submission_requirements_task.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/evaluation_task.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/identification_execute_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/identification_plan_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/peo_common_step.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/python_ast_repl_tool.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/rag_collection_task.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/conversation.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/database/summarized_file_db.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/managers/evaluation_manager.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/rag/__init__.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/rag/config.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/rag/data_pipeline.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/rag/embedder.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/rag/rag.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/settings.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/utils/default.gitignore +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/utils/file_utils.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/utils/gitignore_checker.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/utils/pyphen_utils.py +0 -0
- {bioguider-0.2.14 → bioguider-0.2.15}/bioguider/utils/utils.py +0 -0
|
@@ -5,7 +5,7 @@ from abc import ABC, abstractmethod
|
|
|
5
5
|
from langchain_openai.chat_models.base import BaseChatOpenAI
|
|
6
6
|
from langgraph.graph.graph import CompiledGraph
|
|
7
7
|
|
|
8
|
-
from bioguider.utils.constants import DEFAULT_TOKEN_USAGE
|
|
8
|
+
from bioguider.utils.constants import DEFAULT_TOKEN_USAGE, MAX_STEP_COUNT
|
|
9
9
|
from bioguider.database.summarized_file_db import SummarizedFilesDb
|
|
10
10
|
|
|
11
11
|
class AgentTask(ABC):
|
|
@@ -82,7 +82,7 @@ class AgentTask(ABC):
|
|
|
82
82
|
for s in self.graph.stream(
|
|
83
83
|
input=input,
|
|
84
84
|
stream_mode="values",
|
|
85
|
-
config={"recursion_limit":
|
|
85
|
+
config={"recursion_limit": MAX_STEP_COUNT},
|
|
86
86
|
):
|
|
87
87
|
print(s)
|
|
88
88
|
|
|
@@ -8,6 +8,7 @@ from bioguider.agents.collection_task_utils import CollectionWorkflowState
|
|
|
8
8
|
from bioguider.agents.common_agent_2step import CommonAgentTwoChainSteps, CommonAgentTwoSteps
|
|
9
9
|
from bioguider.agents.peo_common_step import PEOCommonStep
|
|
10
10
|
from bioguider.agents.prompt_utils import COLLECTION_GOAL, COLLECTION_PROMPTS
|
|
11
|
+
from bioguider.utils.constants import MAX_STEP_COUNT
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
COLLECTION_OBSERVE_SYSTEM_PROMPT = """You are an expert software developer and technical documentation analyst.
|
|
@@ -92,11 +93,14 @@ class CollectionObserveStep(PEOCommonStep):
|
|
|
92
93
|
important_instructions=important_instructions,
|
|
93
94
|
)
|
|
94
95
|
def _execute_directly(self, state: CollectionWorkflowState):
|
|
96
|
+
step_count = state["step_count"]
|
|
97
|
+
instruction = "Now, we have reached max recursion limit, please give me the **final answer** based on the current information" \
|
|
98
|
+
if step_count == MAX_STEP_COUNT - 2 else "Let's begin thinking."
|
|
95
99
|
system_prompt = self._build_prompt(state)
|
|
96
100
|
agent = CommonAgentTwoSteps(llm=self.llm)
|
|
97
101
|
res, _, token_usage, reasoning_process = agent.go(
|
|
98
102
|
system_prompt=system_prompt,
|
|
99
|
-
instruction_prompt=
|
|
103
|
+
instruction_prompt=instruction,
|
|
100
104
|
schema=ObservationResult,
|
|
101
105
|
)
|
|
102
106
|
state["final_answer"] = res.FinalAnswer
|
|
@@ -104,9 +108,10 @@ class CollectionObserveStep(PEOCommonStep):
|
|
|
104
108
|
thoughts = res.Thoughts
|
|
105
109
|
state["step_analysis"] = analysis
|
|
106
110
|
state["step_thoughts"] = thoughts
|
|
111
|
+
state["step_count"] += 1
|
|
107
112
|
self._print_step(
|
|
108
113
|
state,
|
|
109
|
-
step_output=f"**Observation Reasoning Process**\n{reasoning_process}"
|
|
114
|
+
step_output=f"**Observation Reasoning Process: {state['step_count']}**\n{reasoning_process}"
|
|
110
115
|
)
|
|
111
116
|
self._print_step(
|
|
112
117
|
state,
|
|
@@ -176,7 +176,7 @@ class CollectionTask(AgentTask):
|
|
|
176
176
|
self.graph = graph.compile()
|
|
177
177
|
|
|
178
178
|
def collect(self) -> list[str] | None:
|
|
179
|
-
s = self._go_graph({"goal_item": self.goal_item})
|
|
179
|
+
s = self._go_graph({"goal_item": self.goal_item, "step_count": 0})
|
|
180
180
|
if s is None or 'final_answer' not in s:
|
|
181
181
|
return None
|
|
182
182
|
if s["final_answer"] is None:
|
|
@@ -5,6 +5,7 @@ from bioguider.agents.agent_utils import ObservationResult
|
|
|
5
5
|
from bioguider.agents.common_agent_2step import CommonAgentTwoSteps, CommonAgentTwoChainSteps
|
|
6
6
|
from bioguider.agents.identification_task_utils import IdentificationWorkflowState
|
|
7
7
|
from bioguider.agents.peo_common_step import PEOWorkflowState, PEOCommonStep
|
|
8
|
+
from bioguider.utils.constants import MAX_STEP_COUNT
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
## observation system prompt
|
|
@@ -76,11 +77,14 @@ class IdentificationObserveStep(PEOCommonStep):
|
|
|
76
77
|
)
|
|
77
78
|
|
|
78
79
|
def _execute_directly(self, state: IdentificationWorkflowState):
|
|
80
|
+
step_count = state["step_count"]
|
|
81
|
+
instruction = "Now, we have reached max recursion limit, please give me the **final answer** based on the current information" \
|
|
82
|
+
if step_count == MAX_STEP_COUNT - 2 else "Now, Let's begin."
|
|
79
83
|
system_prompt = self._prepare_system_prompt(state)
|
|
80
84
|
agent = CommonAgentTwoSteps(llm=self.llm)
|
|
81
85
|
res, _, token_usage, reasoning_process = agent.go(
|
|
82
86
|
system_prompt=system_prompt,
|
|
83
|
-
instruction_prompt=
|
|
87
|
+
instruction_prompt=instruction,
|
|
84
88
|
schema=ObservationResult,
|
|
85
89
|
)
|
|
86
90
|
state["final_answer"] = res.FinalAnswer
|
|
@@ -88,9 +92,10 @@ class IdentificationObserveStep(PEOCommonStep):
|
|
|
88
92
|
thoughts = res.Thoughts
|
|
89
93
|
state["step_analysis"] = analysis
|
|
90
94
|
state["step_thoughts"] = thoughts
|
|
95
|
+
state["step_count"] += 1
|
|
91
96
|
self._print_step(
|
|
92
97
|
state,
|
|
93
|
-
step_output=f"**Observation Reasoning Process**\n{reasoning_process}"
|
|
98
|
+
step_output=f"**Observation Reasoning Process {state['step_count']}**\n{reasoning_process}"
|
|
94
99
|
)
|
|
95
100
|
self._print_step(
|
|
96
101
|
state,
|
|
@@ -173,6 +173,7 @@ class IdentificationTask(AgentTask):
|
|
|
173
173
|
s = self._go_graph({
|
|
174
174
|
"goal": IDENTIFICATION_GOAL_PROJECT_TYPE,
|
|
175
175
|
"final_answer_example": PROJECT_TYPE_FINAL_ANSWER_EXAMPLE,
|
|
176
|
+
"step_count": 0,
|
|
176
177
|
})
|
|
177
178
|
proj_type = s["final_answer"] if "final_answer" in s else "unknown type"
|
|
178
179
|
return self._parse_project_type(proj_type)
|
|
@@ -181,6 +182,7 @@ class IdentificationTask(AgentTask):
|
|
|
181
182
|
s = self._go_graph({
|
|
182
183
|
"goal": IDENTIFICATION_GOAL_PRIMARY_LANGUAGE,
|
|
183
184
|
"final_answer_example": PRIMARY_LANGUAGE_FINAL_ANSWER_EXAMPLE,
|
|
185
|
+
"step_count": 0,
|
|
184
186
|
})
|
|
185
187
|
language = s["final_answer"] if "final_answer" in s else "unknown type"
|
|
186
188
|
return self._parse_primary_language(language)
|
|
@@ -189,6 +191,7 @@ class IdentificationTask(AgentTask):
|
|
|
189
191
|
s = self._go_graph({
|
|
190
192
|
"goal": IDENTIFICATION_GOAL_META_DATA,
|
|
191
193
|
"final_answer_example": META_DATA_FINAL_ANSWER_EXAMPLE,
|
|
194
|
+
"step_count": 0,
|
|
192
195
|
})
|
|
193
196
|
meta_data = s["final_answer"] if "final_answer" in s else "unknown type"
|
|
194
197
|
return self._parse_meta_data(meta_data)
|
|
@@ -205,6 +208,7 @@ class IdentificationTask(AgentTask):
|
|
|
205
208
|
"final_answer_example": final_answer_example,
|
|
206
209
|
"plan_instructions": plan_instructions,
|
|
207
210
|
"observe_instructions": observe_instructions,
|
|
211
|
+
"step_count": 0,
|
|
208
212
|
})
|
|
209
213
|
return s["final_answer"] if "final_answer" in s else None
|
|
210
214
|
|
|
@@ -208,6 +208,7 @@ If **any one** of these is present, the document should be classified as Contrib
|
|
|
208
208
|
""",
|
|
209
209
|
"plan_important_instructions": """ - A comiled standalone software file is non-textual and appears to be in an executable format (e.g., `.exe`, `.dll`, `.so`, `.bin`, `.elf`).
|
|
210
210
|
- A comiled standalone software file **is not a script or compiled library**, that is, It is not a wrapper script (e.g., shell, Python, Python notebook or Rmd) nor a dynamic/shared library meant for linking.
|
|
211
|
+
So, when you are identifying a binary file, **do not** use any tools (our tools don't work for binary file), you need to figure out if it is compiled standalone software file by the file name and extension on your own.
|
|
211
212
|
- When identifying source code file, prioritize analyzing the file's **extension** and **file name** and try to avoid reading file, using check_file_related_tool or summarizing file content.
|
|
212
213
|
- When identifying example data, prioritize analyzing the file's **extension** (like .dat, .csv, .fastq, and so on) and **file name** (like example_data.txt, example.dat, and so on). If extension/name is ambiguous, use summarizing file content to decide.
|
|
213
214
|
- **Note**: You **only need to detect** whether at least **one** compiled standalone software file, **one** source code file and **one** example data file exist — no need to list all such files.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bioguider-0.2.14 → bioguider-0.2.15}/bioguider/agents/evaluation_submission_requirements_task.py
RENAMED
|
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
|
|
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
|