+ {isLoadingModels ? (
+ <>
+ {Array.from({ length: 3 }).map((_, i) => (
+
+
+
+ ))}
+ >
+ ) : shakespeareModels.length === 0 ? (
+
+
+
+
+ No models available. Please check your connection and try again.
+
+
+
+ ) : (
+ shakespeareModels.map((model) => {
+ const isSelected = selectedModel === model.fullId;
+ const isFree = !model.pricing || (
+ model.pricing.prompt.equals(0) && model.pricing.completion.equals(0)
+ );
+
+ return (
+
handleModelSelect(model.fullId)}
+ >
+
+
+
+ {model.name}
+
+
+ {isFree && (
+
+ Free
+
+ )}
+ {isSelected && (
+
+
+
+ )}
+
+
+
+
+ {model.description && (
+
+ {model.description}
+
+ )}
+
+ {model.pricing && (
+ <>
+ Input: {formatPrice(model.pricing.prompt)}
+ Output: {formatPrice(model.pricing.completion)}
+ >
+ )}
+ {model.contextLength && (
+ Context: {model.contextLength.toLocaleString()} tokens
+ )}
+
+
+
+ );
+ })
+ )}
+
+