fix: use correct model ID 'claude-sonnet-4-5' for Shakespeare AI calls
The model name 'shakespeare' does not exist on the API — it was returning: "Model 'shakespeare' is not supported" (400 invalid_request_error) Updated both sendChatMessage calls in SasquatchGuide and the default model in useShakespeare hook (sendChatMessage + sendStreamingMessage). Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
parent
4214845d78
commit
2aeb41afdc
2 changed files with 4 additions and 4 deletions
|
|
@ -204,7 +204,7 @@ export function SasquatchGuide({ message, onDismiss }: SasquatchGuideProps) {
|
||||||
|
|
||||||
const firstResponse = await shakespeare.sendChatMessage(
|
const firstResponse = await shakespeare.sendChatMessage(
|
||||||
historyWithContext,
|
historyWithContext,
|
||||||
'shakespeare'
|
'claude-sonnet-4-5'
|
||||||
);
|
);
|
||||||
|
|
||||||
const aiText = firstResponse.choices[0]?.message?.content as string ?? '';
|
const aiText = firstResponse.choices[0]?.message?.content as string ?? '';
|
||||||
|
|
@ -254,7 +254,7 @@ export function SasquatchGuide({ message, onDismiss }: SasquatchGuideProps) {
|
||||||
role: 'user' as const,
|
role: 'user' as const,
|
||||||
content: `${SYSTEM_PROMPT}\n\n---\n\nUser asked: ${question}\n\nTool result from ${toolName}:\n${toolResultStr}\n\nNow answer the user's question naturally based on this live data. Be concise and skater-friendly.`,
|
content: `${SYSTEM_PROMPT}\n\n---\n\nUser asked: ${question}\n\nTool result from ${toolName}:\n${toolResultStr}\n\nNow answer the user's question naturally based on this live data. Be concise and skater-friendly.`,
|
||||||
},
|
},
|
||||||
], 'shakespeare');
|
], 'claude-sonnet-4-5');
|
||||||
|
|
||||||
accumulated = secondResponse.choices[0]?.message?.content as string ?? '';
|
accumulated = secondResponse.choices[0]?.message?.content as string ?? '';
|
||||||
} catch (toolErr) {
|
} catch (toolErr) {
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ export function useShakespeare() {
|
||||||
// Chat completion function
|
// Chat completion function
|
||||||
const sendChatMessage = useCallback(async (
|
const sendChatMessage = useCallback(async (
|
||||||
messages: ChatMessage[],
|
messages: ChatMessage[],
|
||||||
model: string = 'shakespeare',
|
model: string = 'claude-sonnet-4-5',
|
||||||
options?: Partial<ChatCompletionRequest>
|
options?: Partial<ChatCompletionRequest>
|
||||||
): Promise<ChatCompletionResponse> => {
|
): Promise<ChatCompletionResponse> => {
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
|
@ -218,7 +218,7 @@ export function useShakespeare() {
|
||||||
// Streaming chat completion function
|
// Streaming chat completion function
|
||||||
const sendStreamingMessage = useCallback(async (
|
const sendStreamingMessage = useCallback(async (
|
||||||
messages: ChatMessage[],
|
messages: ChatMessage[],
|
||||||
model: string = 'shakespeare',
|
model: string = 'claude-sonnet-4-5',
|
||||||
onChunk: (chunk: string) => void,
|
onChunk: (chunk: string) => void,
|
||||||
options?: Partial<ChatCompletionRequest>
|
options?: Partial<ChatCompletionRequest>
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue