I hope you can assist me. I’m trying to swap in a different model to the RestrictToTopic using LLmlite. From the Documentation I think I have the right approach.
I have the following code :
response = Tennis and basketball are both popular sports, but they have some significant differences.
Tennis is an individual sport played with a racket and a small, hollow ball called a tennis ball. The game is played on a rectangular court with a net in the middle. The objective is to hit the ball over the net and into the opponent's court, while ensuring that the ball bounces once on your side of the court. The player who wins a set by scoring four points (with a margin of two points) wins the match.
ts."
guard = Guard().use(
RestrictToTopic(
litellm.completion,
model="ollama/llama2",
llm_callable="ollama/llama2",
disable_classifier=False,
disable_llm=False,
valid_topics=["food"],
invalid_topics=["music", "music"],
on_fail="exception",
)
)
guard.validate(response)
hen I run this code, I get an error:
RestrictToTopic(
TypeError: RestrictToTopic.__init__() got multiple values for argument 'valid_topics'
Can anyone point out where I am going wrong. Thanks