You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can see that I need to learn how to setup an efficient workflow, modularize my code and configure automated testing. This is not currently well described.
Please
Describe the existence and use of guidance.llms.Mock().
Describe an example of using pytest and the Mock
Describe a recommended workflow for developing, modularizing and testing some larger Program/ template/ prompt.
The text was updated successfully, but these errors were encountered:
An example like the below would have helped really a lot. Took me 1 hour and involved exploring the guidance repository, the guidance issues and trying out creating my own mock etc.
importguidanceimportpytestdeftest_guidance_mock_example():
# Givenguidance.llm=guidance.llms.Mock(["The answer is 2"])
template="""{{#user~}}What is 1+1{{~/user}}{{#assistant~}}{{gen 'result'}}{{~/assistant}}"""# Whenprogram=guidance(template)
result=program()
# Thenassertresult.text=="""<|im_start|>userWhat is 1+1<|im_end|><|im_start|>assistantThe answer is 2<|im_end|>"""
I'm new to
guidance
andhandlebars
templates.I can see that I need to learn how to setup an efficient workflow, modularize my code and configure automated testing. This is not currently well described.
Please
guidance.llms.Mock()
.Mock
The text was updated successfully, but these errors were encountered: