-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enhance API and fix deserialization issues (#22)
1. Encapsulated new open api for templates, datasets and workflows. 2. Fixed the bug of deserializing enumeration values. 3. Replaced the deserialized enumeration values with constants.
- Loading branch information
Showing
139 changed files
with
2,309 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.coze.openapi.api; | ||
|
||
import com.coze.openapi.client.common.BaseReq; | ||
import com.coze.openapi.client.common.BaseResponse; | ||
import com.coze.openapi.client.dataset.CreateDatasetReq; | ||
import com.coze.openapi.client.dataset.CreateDatasetResp; | ||
import com.coze.openapi.client.dataset.DeleteDatasetResp; | ||
import com.coze.openapi.client.dataset.ListDatasetResp; | ||
import com.coze.openapi.client.dataset.ProcessDatasetReq; | ||
import com.coze.openapi.client.dataset.ProcessDatasetResp; | ||
import com.coze.openapi.client.dataset.UpdateDatasetReq; | ||
import com.coze.openapi.client.dataset.UpdateDatasetResp; | ||
|
||
import retrofit2.Call; | ||
import retrofit2.http.*; | ||
|
||
public interface DatasetAPI { | ||
@POST("v1/datasets") | ||
Call<BaseResponse<CreateDatasetResp>> create(@Body CreateDatasetReq req, @Tag BaseReq baseReq); | ||
|
||
@GET("v1/datasets") | ||
Call<BaseResponse<ListDatasetResp>> list( | ||
@Query("space_id") String spaceID, | ||
@Query("name") String name, | ||
@Query("format_type") Integer formatType, | ||
@Query("page_size") Integer pageSize, | ||
@Query("page_num") Integer pageNum, | ||
@Tag BaseReq baseReq); | ||
|
||
@PUT("v1/datasets/{dataset_id}") | ||
Call<BaseResponse<UpdateDatasetResp>> update( | ||
@Path("dataset_id") String datasetID, @Body UpdateDatasetReq req, @Tag BaseReq baseReq); | ||
|
||
@DELETE("v1/datasets/{dataset_id}") | ||
Call<BaseResponse<DeleteDatasetResp>> delete( | ||
@Path("dataset_id") String datasetID, @Tag BaseReq baseReq); | ||
|
||
@POST("v1/datasets/{dataset_id}/process") | ||
Call<BaseResponse<ProcessDatasetResp>> process( | ||
@Path("dataset_id") String datasetID, @Body ProcessDatasetReq req, @Tag BaseReq baseReq); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
api/src/main/java/com/coze/openapi/api/DatasetImageAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.coze.openapi.api; | ||
|
||
import com.coze.openapi.client.common.BaseReq; | ||
import com.coze.openapi.client.common.BaseResponse; | ||
import com.coze.openapi.client.dataset.image.ListImageResp; | ||
import com.coze.openapi.client.dataset.image.UpdateImageReq; | ||
import com.coze.openapi.client.dataset.image.UpdateImageResp; | ||
|
||
import retrofit2.Call; | ||
import retrofit2.http.*; | ||
|
||
public interface DatasetImageAPI { | ||
@PUT("v1/datasets/{dataset_id}/images/{document_id}") | ||
Call<BaseResponse<UpdateImageResp>> update( | ||
@Path("dataset_id") String datasetID, | ||
@Path("document_id") String documentID, | ||
@Body UpdateImageReq req, | ||
@Tag BaseReq baseReq); | ||
|
||
@GET("v1/datasets/{dataset_id}/images") | ||
Call<BaseResponse<ListImageResp>> list( | ||
@Path("dataset_id") String datasetID, | ||
@Query("keyword") String keyword, | ||
@Query("has_caption") Boolean hasCaption, | ||
@Query("page_num") Integer pageNum, | ||
@Query("page_size") Integer pageSize, | ||
@Tag BaseReq baseReq); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.coze.openapi.api; | ||
|
||
import com.coze.openapi.client.common.BaseReq; | ||
import com.coze.openapi.client.common.BaseResponse; | ||
import com.coze.openapi.client.template.DuplicateTemplateReq; | ||
import com.coze.openapi.client.template.DuplicateTemplateResp; | ||
|
||
import retrofit2.Call; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.POST; | ||
import retrofit2.http.Path; | ||
import retrofit2.http.Tag; | ||
|
||
public interface TemplateAPI { | ||
@POST("/v1/templates/{template_id}/duplicate") | ||
Call<BaseResponse<DuplicateTemplateResp>> duplicate( | ||
@Path("template_id") String templateID, @Body DuplicateTemplateReq req, @Tag BaseReq baseReq); | ||
} |
17 changes: 17 additions & 0 deletions
17
api/src/main/java/com/coze/openapi/api/WorkflowChatAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.coze.openapi.api; | ||
|
||
import com.coze.openapi.client.common.BaseReq; | ||
import com.coze.openapi.client.workflows.chat.WorkflowChatReq; | ||
|
||
import okhttp3.ResponseBody; | ||
import retrofit2.Call; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.POST; | ||
import retrofit2.http.Streaming; | ||
import retrofit2.http.Tag; | ||
|
||
public interface WorkflowChatAPI { | ||
@POST("/v1/workflows/chat") | ||
@Streaming | ||
Call<ResponseBody> stream(@Body WorkflowChatReq req, @Tag BaseReq baseReq); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomAudioConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* (C)2024 */ | ||
package com.coze.openapi.client.audio.rooms.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
|
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/audio/voices/model/Voice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/auth/GetPKCEAuthURLResp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* (C)2024 */ | ||
package com.coze.openapi.client.auth; | ||
|
||
import lombok.AllArgsConstructor; | ||
|
38 changes: 30 additions & 8 deletions
38
api/src/main/java/com/coze/openapi/client/auth/GrantType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/auth/scope/Scope.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* (C)2024 */ | ||
package com.coze.openapi.client.auth.scope; | ||
|
||
import java.util.Collections; | ||
|
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/auth/scope/ScopeAccountPermission.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* (C)2024 */ | ||
package com.coze.openapi.client.auth.scope; | ||
|
||
import java.util.List; | ||
|
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/auth/scope/ScopeAttributeConstraint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* (C)2024 */ | ||
package com.coze.openapi.client.auth.scope; | ||
|
||
import lombok.AllArgsConstructor; | ||
|
1 change: 0 additions & 1 deletion
1
...com/coze/openapi/client/auth/scope/ScopeAttributeConstraintConnectorBotChatAttribute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* (C)2024 */ | ||
package com.coze.openapi.client.auth.scope; | ||
|
||
import java.util.List; | ||
|
1 change: 0 additions & 1 deletion
1
api/src/main/java/com/coze/openapi/client/bots/model/BotKnowledge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* (C)2024 */ | ||
package com.coze.openapi.client.bots.model; | ||
|
||
import java.util.List; | ||
|
Oops, something went wrong.