model pickup

This commit is contained in:
Andrew Trokhymenko
2024-11-21 00:17:06 -05:00
parent 302cd28775
commit 937ba7e61b
3 changed files with 12 additions and 4 deletions

View File

@@ -31,11 +31,14 @@ function parseCookies(cookieHeader) {
async function chatAction({ context, request }: ActionFunctionArgs) {
const { messages, imageData } = await request.json<{
const { messages, imageData, model } = await request.json<{
messages: Messages,
imageData?: string[]
imageData?: string[],
model: string
}>();
console.log('ChatAction:', JSON.stringify(messages));
const cookieHeader = request.headers.get("Cookie");
// Parse the cookie's value (returns an object or null if no cookie exists)
@@ -47,6 +50,7 @@ async function chatAction({ context, request }: ActionFunctionArgs) {
const options: StreamingOptions = {
toolChoice: 'none',
apiKeys,
model,
onFinish: async ({ text: content, finishReason }) => {
if (finishReason !== 'length') {
return stream.close();