MCPcopy
hub / github.com/SqueezeAILab/LLMCompiler / join

Method join

src/llm_compiler/llm_compiler.py:201–225  ·  view source on GitHub ↗
(
        self, input_query: str, agent_scratchpad: str, is_final: bool
    )

Source from the content-addressed store, hash-verified

199 return formatted_contexts
200
201 async def join(
202 self, input_query: str, agent_scratchpad: str, is_final: bool
203 ) -> str:
204 if is_final:
205 joinner_prompt = self.joinner_prompt_final
206 else:
207 joinner_prompt = self.joinner_prompt
208 prompt = (
209 f"{joinner_prompt}\n" # Instructions and examples
210 f"Question: {input_query}\n\n" # User input query
211 f"{agent_scratchpad}\n" # T-A-O
212 # "---\n"
213 )
214 log("Joining prompt:\n", prompt, block=True)
215 response = await self.agent.arun(
216 prompt, callbacks=[self.executor_callback] if self.benchmark else None
217 )
218 raw_answer = cast(str, response)
219 log("Question: \n", input_query, block=True)
220 log("Raw Answer: \n", raw_answer, block=True)
221 thought, answer, is_replan = self._parse_joinner_output(raw_answer)
222 if is_final:
223 # If final, we don't need to replan
224 is_replan = False
225 return thought, answer, is_replan
226
227 def _call(
228 self,

Callers 10

_acallMethod · 0.95
run_llm_math_chainFunction · 0.80
white_space_fixFunction · 0.80
remove_puncFunction · 0.80
_get_page_obsMethod · 0.80
visit_CallMethod · 0.80
_runMethod · 0.80
_arunMethod · 0.80
create_promptMethod · 0.80

Calls 3

_parse_joinner_outputMethod · 0.95
logFunction · 0.90
arunMethod · 0.45

Tested by

no test coverage detected