dify-client #95

Closed
opened 2026-02-16 10:16:06 -05:00 by yindo · 1 comment
Owner

Originally created by @heartsec on GitHub (Nov 10, 2025).

api/route.ts

import type { NextRequest } from 'next/server'
import { client, getInfo } from '@/app/api/utils/common'

export async function POST(request: NextRequest) {
  const body = await request.json()
  const {
    inputs,
    query,
    files,
    conversation_id: conversationId,
    response_mode: responseMode,
  } = body
  const { user } = getInfo(request)
  // dify-client params: stream should be boolean,not "streaming" or "blocking"
  const stream = responseMode === 'streaming'
  const res = await client.createChatMessage(inputs, query, user, stream, conversationId, files)
  return new Response(res.data as any)
}
Originally created by @heartsec on GitHub (Nov 10, 2025). [api/route.ts](https://github.com/langgenius/webapp-conversation/blob/main/app/api/chat-messages/route.ts) ```typescript import type { NextRequest } from 'next/server' import { client, getInfo } from '@/app/api/utils/common' export async function POST(request: NextRequest) { const body = await request.json() const { inputs, query, files, conversation_id: conversationId, response_mode: responseMode, } = body const { user } = getInfo(request) // dify-client params: stream should be boolean,not "streaming" or "blocking" const stream = responseMode === 'streaming' const res = await client.createChatMessage(inputs, query, user, stream, conversationId, files) return new Response(res.data as any) } ```
yindo closed this issue 2026-02-16 10:16:06 -05:00
Author
Owner

@crazywoola commented on GitHub (Feb 4, 2026):

Hi @heartsec, thanks for opening this issue.

Why this is being closed

This report does not yet meet the required issue standard for langgenius/webapp-conversation.

  • Use a clear and descriptive issue title.

Relevant guidelines

Next steps

Please open a new issue in English and include all required details from the bug template/contributing guide.

Thanks for understanding and for your contribution.

@crazywoola commented on GitHub (Feb 4, 2026): Hi @heartsec, thanks for opening this issue. ### Why this is being closed This report does not yet meet the required issue standard for `langgenius/webapp-conversation`. - Use a clear and descriptive issue title. ### Relevant guidelines - Bug report template: https://github.com/langgenius/dify/blob/3aecceff27c6b712628ad463c6e6ac15b8527ebe/.github/ISSUE_TEMPLATE/bug_report.yml - Code of Conduct / Language Policy: https://github.com/langgenius/dify/blob/4c1ad40f8e8a6ee58a958330558f2178b7e47fa7/.github/CODE_OF_CONDUCT.md - Contributing guide: https://github.com/langgenius/dify/blob/25ac69afc5ac9324079be5f0d02b2a2b03dcc784/CONTRIBUTING.md ### Next steps Please open a new issue in English and include all required details from the bug template/contributing guide. Thanks for understanding and for your contribution.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/webapp-conversation#95