MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / __init__

Method __init__

camel/runtime/llm_guard_runtime.py:77–104  ·  view source on GitHub ↗
(
        self,
        prompt: str = GUARDPROMPT,
        model: Optional[BaseModelBackend] = None,
        verbose: bool = False,
    )

Source from the content-addressed store, hash-verified

75 """
76
77 def __init__(
78 self,
79 prompt: str = GUARDPROMPT,
80 model: Optional[BaseModelBackend] = None,
81 verbose: bool = False,
82 ):
83 super().__init__()
84 self.prompt = prompt
85 self.model = model
86 self.verbose = verbose
87
88 if not self.model:
89 self.model = ModelFactory.create(
90 model_platform=ModelPlatformType.DEFAULT,
91 model_type=ModelType.DEFAULT,
92 model_config_dict=ChatGPTConfig().as_dict(),
93 )
94 self.ignore_toolkit = IgnoreRiskToolkit(verbose=verbose)
95 self.ignore_tool = self.ignore_toolkit.get_tools()[0]
96 self.tools_map[self.ignore_tool.get_function_name()] = self.ignore_tool
97
98 self.agent = ChatAgent(
99 system_message=self.prompt,
100 model=self.model,
101 external_tools=[
102 *FunctionRiskToolkit(verbose=verbose).get_tools(),
103 ],
104 )
105
106 def add( # type: ignore[override]
107 self,

Callers

nothing calls this directly

Calls 8

ChatGPTConfigClass · 0.90
IgnoreRiskToolkitClass · 0.90
ChatAgentClass · 0.90
FunctionRiskToolkitClass · 0.90
createMethod · 0.45
as_dictMethod · 0.45
get_toolsMethod · 0.45
get_function_nameMethod · 0.45

Tested by

no test coverage detected