MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / __call__

Method __call__

src/hyperagent/agents/llms.py:87–102  ·  view source on GitHub ↗
(self, prompt: str)

Source from the content-addressed store, hash-verified

85 )
86
87 def __call__(self, prompt: str):
88 # The line `prompt = truncate_tokens(prompt, encoding_name=self.config["model"],
89 # max_length=self.config["max_tokens"])` is calling a function named `truncate_tokens` with
90 # three arguments: `prompt`, `encoding_name`, and `max_length`. This function is likely used
91 # to truncate the input `prompt` to a specified maximum length based on the model being used
92 # and the maximum tokens allowed.
93 # prompt = truncate_tokens(prompt, encoding_name=self.config["model"], max_length=self.config["max_tokens"])
94 response = self.client.chat.completions.create(
95 temperature=0,
96 model=self.config["model"],
97 messages=[
98 {"role": "system", "content": self.system_prompt},
99 {"role": "user", "content": prompt},
100 ]
101 )
102 return response.choices[0].message.content
103
104
105class AzureLLM(LLM):

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected