Created
February 13, 2024 23:34
-
-
Save zzstoatzz/ae670c6b1f05537c1d4b03aaef581eba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import marvin | |
@marvin.fn | |
def rank_answers(question: str, answers: list[str], context: str) -> list[str]: | |
"""Rank answers to a question based on context""" | |
if __name__ == "__main__": | |
ranked_answers = rank_answers( | |
question="What is the best programming language?", | |
answers=[ | |
"Java", | |
"C++", | |
"Javascript", | |
"Haskell", | |
"Golang", | |
], | |
context="For web development" | |
) | |
print(ranked_answers) # ['Javascript', 'Golang', 'Java', 'C++', 'Haskell'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment