Skip to content

Releases: imfangs/dify-java-client

v1.6.0

Choose a tag to compare

@imfangs imfangs released this 10 Jul 14:17

Changes

  • Add Service API for Knowledge Pipeline (RAG Pipeline) — 4 new endpoints on DifyDatasetsClient
    • List<DatasourcePluginResponse> listPipelineDatasourcePlugins(String datasetId, Boolean isPublished)GET /datasets/{id}/pipeline/datasource-plugins
    • void runPipelineDatasourceNodeStream(...)POST /datasets/{id}/pipeline/datasource/nodes/{node_id}/run, SSE stream of node execution events
    • Map<String,Object> runPipeline(String datasetId, PipelineRunRequest request)POST /datasets/{id}/pipeline/run in blocking mode
    • void runPipelineStream(String datasetId, PipelineRunRequest request, WorkflowStreamCallback callback) — same route in streaming mode
    • PipelineFileUploadResponse uploadPipelineFile(File file) / uploadPipelineFile(InputStream, String, String)POST /datasets/pipeline/file-upload
  • New models: DatasourcePluginResponse (with nested CredentialInfo), DatasourceNodeRunRequest, PipelineRunRequest, PipelineFileUploadResponse
  • Internal refactor: promoted streaming (SSE) helpers (executeStreamRequest, executeGetStreamRequest, processStreamLine, LineProcessor, EventProcessor) from DefaultDifyClient to AbstractDifyClient. Non-breaking; enables DefaultDifyDatasetsClient to consume SSE streams and simplifies future dataset streaming endpoints

Installation

<dependency>
    <groupId>io.github.imfangs</groupId>
    <artifactId>dify-java-client</artifactId>
    <version>1.6.0</version>
</dependency>

v1.5.0

Choose a tag to compare

@imfangs imfangs released this 10 Jul 14:09

Changes

  • Add Service API for batch document download as ZIP (POST /datasets/{dataset_id}/documents/download-zip)
    • New method on DifyDatasetsClient: FilePreviewResponse downloadDocumentsAsZip(String datasetId, DocumentBatchDownloadRequest request)
    • Up to 100 document IDs per call; returns application/zip binary stream (InputStream + metadata)
    • New model: DocumentBatchDownloadRequest
  • Add Service API for single document signed download URL (GET /datasets/{dataset_id}/documents/{document_id}/download)
    • New method on DifyDatasetsClient: DocumentDownloadUrlResponse getDocumentDownloadUrl(String datasetId, String documentId)
    • Returns a short-lived signed URL for the original uploaded file
    • New model: DocumentDownloadUrlResponse
  • Add support for the reasoning_chunk streaming event (Chatflow apps with LLM node reasoning_format=separated)
    • New enum: EventType.REASONING_CHUNK
    • New event model: ReasoningChunkEvent (with nested data: message_id, reasoning, node_id, is_final)
    • New callback hook on ChatflowStreamCallback and WorkflowStreamCallback: onReasoningChunk
    • Enables rendering the model's chain-of-thought stream in parallel with the answer, without mixing <think> into the message body

Installation

<dependency>
    <groupId>io.github.imfangs</groupId>
    <artifactId>dify-java-client</artifactId>
    <version>1.5.0</version>
</dependency>

v1.4.0

Choose a tag to compare

@imfangs imfangs released this 10 Jul 13:29

Changes

  • Add Service API for End User lookup (GET /end-users/{end_user_id})
    • New method on DifyBaseClient (available on chat/chatflow/workflow/completion clients): EndUserResponse getEndUser(String endUserId)
    • New model: EndUserResponse (id, tenant_id, app_id, type, external_user_id, name, is_anonymous, session_id, created_at, updated_at)
    • Use case: when other APIs return created_by as an end-user ID, resolve external_user_id / session_id
  • Add Service API for Human Input Form (companion to the Human Input events shipped in 1.3.0)
    • HumanInputFormResponse getHumanInputForm(String formToken)GET /form/human_input/{form_token}, fetch a paused form definition
    • void submitHumanInputForm(String formToken, HumanInputFormSubmitRequest request)POST /form/human_input/{form_token}, submit inputs + selected action + user to resume the workflow
    • Methods live on DifyBaseClient so both workflow and chatflow apps can call them
    • New models: HumanInputFormResponse, HumanInputFormSubmitRequest
  • Add Service API for Workflow Resume Events stream (GET /workflow/{workflow_run_id}/events)
    • New method on DifyWorkflowClient: void streamWorkflowEvents(String workflowRunId, String user, Boolean includeStateSnapshot, Boolean continueOnPause, WorkflowStreamCallback callback)
    • After submitting a human-input form, use this endpoint to re-subscribe to the resumed workflow's events (SSE)
    • include_state_snapshot=true replays a status summary of already-executed nodes; continue_on_pause=true keeps the stream open across multiple pauses
  • Introduce reusable GET-SSE helper (executeGetStreamRequest) for future streaming endpoints

Installation

<dependency>
    <groupId>io.github.imfangs</groupId>
    <artifactId>dify-java-client</artifactId>
    <version>1.4.0</version>
</dependency>

v1.3.0

Choose a tag to compare

@imfangs imfangs released this 10 Jul 11:52

Changes

  • Add Human Input (HITL) workflow event support for Dify 1.14.2+ (#162)
    • New events: human_input_required, workflow_paused, human_input_form_filled, human_input_form_timeout
    • New event models: HumanInputRequiredEvent, WorkflowPausedEvent, HumanInputFormFilledEvent, HumanInputFormTimeoutEvent
    • New callback hooks on WorkflowStreamCallback and ChatflowStreamCallback: onHumanInputRequired, onWorkflowPaused, onHumanInputFormFilled, onHumanInputFormTimeout

v1.2.7

Choose a tag to compare

@imfangs imfangs released this 07 May 02:53

Changes

  • Optimize streaming response handling by introducing terminal event constants for different app types (#161)
    • Chat/Completion streams now terminate on message_end or error
    • Chatflow/Workflow streams now terminate on workflow_finished or error
    • Fixes issue where Chatflow events after message_end were being lost
  • Add missing fields to DetailedDocumentResponse: doc_type, doc_metadata, summary_index_status, need_summary (#160)