Merge pull request #332 from atrokhym/main

HIGH PRIORITY - Attach images to prompts
This commit is contained in:
Cole Medin
2024-12-04 10:53:37 -06:00
committed by GitHub
12 changed files with 276 additions and 52 deletions

View File

@@ -32,8 +32,9 @@ function parseCookies(cookieHeader) {
}
async function chatAction({ context, request }: ActionFunctionArgs) {
const { messages } = await request.json<{
const { messages, model } = await request.json<{
messages: Messages;
model: string;
}>();
const cookieHeader = request.headers.get('Cookie');
@@ -47,6 +48,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();