MCPcopy Create free account
hub / github.com/Re-Align/just-eval / OpenAIModelManager

Class OpenAIModelManager

just_eval/utils.py:21–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class OpenAIModelManager:
22
23 def __init__(self, model_name):
24 self.model_name = model_name
25 assert openai.api_key is not None
26
27 def infer_generate(self, input_text, max_tokens=2048):
28 output = completion_with_backoff(
29 model=self.model_name,
30 messages=[
31 {"role": "user", "content": input_text}
32 ],
33 n=1, temperature=0, top_p=1,
34 max_tokens=max_tokens,
35 )
36 return output
37
38
39

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected