MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / get_prompt

Function get_prompt

eval_heldout/rewoo/nodes/LLMNode.py:50–60  ·  view source on GitHub ↗
(conv: Conversation)

Source from the content-addressed store, hash-verified

48 return len(tokenizer.encode(text))
49
50def get_prompt(conv: Conversation) -> str:
51 if conv.name == 'openchat':
52 ret = ''
53 for role, message in conv.messages:
54 if message:
55 ret += role + ": " + message.strip() + conv.sep
56 else:
57 ret += role + ":"
58 return ret
59 else:
60 return conv.get_prompt()
61
62def llm_llama(prompt: str) -> str:
63 CONTROLLER_ADDR = os.environ['CONTROLLER_ADDR'].split(',')

Callers 1

call_llmMethod · 0.70

Calls 1

get_promptMethod · 0.80

Tested by

no test coverage detected