MCPcopy
hub / github.com/Cinnamon/kotaemon / populate

Method populate

libs/kotaemon/kotaemon/llms/prompts/template.py:75–92  ·  view source on GitHub ↗

Strictly populate the template with the given keyword arguments. Args: **kwargs: The keyword arguments to populate the template. Each keyword corresponds to a placeholder in the template. Returns: The populated template.

(self, safe=True, **kwargs)

Source from the content-addressed store, hash-verified

73 )
74
75 def populate(self, safe=True, **kwargs) -> str:
76 """
77 Strictly populate the template with the given keyword arguments.
78
79 Args:
80 **kwargs: The keyword arguments to populate the template.
81 Each keyword corresponds to a placeholder in the template.
82
83 Returns:
84 The populated template.
85
86 Raises:
87 ValueError: If an unknown placeholder is provided.
88 """
89 if safe:
90 self.check_missing_kwargs(**kwargs)
91
92 return self.partial_populate(**kwargs)
93
94 def partial_populate(self, **kwargs):
95 """

Callers 15

runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
get_promptMethod · 0.95
get_promptMethod · 0.95

Calls 2

check_missing_kwargsMethod · 0.95
partial_populateMethod · 0.95