Skip to content

Commit 5d3d7b3

Browse files
committed
fix(dsp): indicate other completions only if choices is list, not string
1 parent 09f9884 commit 5d3d7b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dsp/modules/lm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def inspect_history(self, n: int = 1, skip: int = 0):
7676
text = choices
7777
elif provider == "openai" or provider == "ollama":
7878
text = ' ' + self._get_choice_text(choices[0]).strip()
79-
elif provider == "clarifai" or provider == "claude" :
80-
text=choices
79+
elif provider == "clarifai" or provider == "claude":
80+
text = choices
8181
elif provider == "groq":
8282
text = ' ' + choices
8383
elif provider == "google":
@@ -88,7 +88,7 @@ def inspect_history(self, n: int = 1, skip: int = 0):
8888
text = choices[0]["text"]
8989
printing_value += self.print_green(text, end="")
9090

91-
if len(choices) > 1:
91+
if len(choices) > 1 and isinstance(choices, list):
9292
printing_value += self.print_red(f" \t (and {len(choices)-1} other completions)", end="")
9393

9494
printing_value += "\n\n\n"

0 commit comments

Comments
 (0)