(self,
inner_step: List[Dict],
plugin_executor: ActionExecutor = None,
**kwargs)
| 88 | execute=execute) |
| 89 | |
| 90 | def format(self, |
| 91 | inner_step: List[Dict], |
| 92 | plugin_executor: ActionExecutor = None, |
| 93 | **kwargs) -> list: |
| 94 | formatted = [] |
| 95 | if self.meta_prompt: |
| 96 | formatted.append(dict(role='system', content=self.meta_prompt)) |
| 97 | if self.plugin_prompt: |
| 98 | plugin_prompt = self.plugin_prompt.format(tool_info=json.dumps( |
| 99 | plugin_executor.get_actions_info(), ensure_ascii=False)) |
| 100 | formatted.append( |
| 101 | dict(role='system', content=plugin_prompt, name='plugin')) |
| 102 | if self.interpreter_prompt: |
| 103 | formatted.append( |
| 104 | dict(role='system', |
| 105 | content=self.interpreter_prompt, |
| 106 | name='interpreter')) |
| 107 | if self.few_shot: |
| 108 | for few_shot in self.few_shot: |
| 109 | formatted += self.format_sub_role(few_shot) |
| 110 | formatted += self.format_sub_role(inner_step) |
| 111 | return formatted |
| 112 | |
| 113 | |
| 114 | class WebSearchGraph: |
no outgoing calls
no test coverage detected