智能体列表,全部

This commit is contained in:
weber
2025-08-06 15:58:17 +08:00
parent 993604bfc1
commit a944bd0fa3
9 changed files with 318 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
package com.aiosman.ravenow.data
import com.aiosman.ravenow.AppStore
import com.aiosman.ravenow.data.api.ApiClient
import com.aiosman.ravenow.entity.AgentEntity
import com.aiosman.ravenow.entity.ProfileEntity
@@ -22,8 +23,6 @@ data class Agent(
val isPublic: Boolean,
@SerializedName("openId")
val openId: String,
@SerializedName("profile")
val profile: Profile,
@SerializedName("title")
val title: String,
@SerializedName("updatedAt")
@@ -38,13 +37,12 @@ data class Agent(
desc = desc,
createdAt = createdAt,
updatedAt = updatedAt,
avatar = "${ApiClient.BASE_SERVER}$avatar",
author = author,
avatar = "${ApiClient.BASE_API_URL+"/outside"}$avatar"+"?token="+"Bearer ${AppStore.token}",
//author = author,
isPublic = isPublic,
openId = openId,
breakMode = breakMode,
useCount = useCount,
profile = profile.toProfileEntity(),
)
}
}

View File

@@ -38,6 +38,11 @@ data class AgentMomentRequestBody(
val sessionId: String
)
data class SingleChatRequestBody(
@SerializedName("agentOpenId")
val generateText: String,
)
data class LoginUserRequestBody(
@SerializedName("username")
val username: String? = null,
@@ -470,12 +475,14 @@ interface RaveNowAPI {
suspend fun getAgent(
@Query("page") page: Int = 1,
@Query("pageSize") pageSize: Int = 20,
): Response<ListContainer<Agent>>
@Query("withWorkflow") withWorkflow: Int = 1,
): Response<DataContainer<ListContainer<Agent>>>
@GET("outside/my/prompts")
suspend fun getMyAgent(
@Query("page") page: Int = 1,
@Query("pageSize") pageSize: Int = 20,
@Query("withWorkflow") withWorkflow: Int = 1,
): Response<ListContainer<Agent>>
@Multipart
@@ -483,12 +490,25 @@ interface RaveNowAPI {
suspend fun createAgent(
@Part avatar: MultipartBody.Part?,
@Part("title") title: RequestBody?,
@Part("value") value: RequestBody?,
@Part("desc") desc: RequestBody?,
@Part("workflowId") workflowId: RequestBody?,
@Part("public") isPublic: RequestBody?,
@Part("breakMode") breakMode: RequestBody?,
@Part("useWorkflow") useWorkflow: RequestBody?,
@Part("workflowInputs") workflowInputs: RequestBody?,
): Response<DataContainer<Agent>>
@POST("generate/postText")
suspend fun agentMoment(@Body body: AgentMomentRequestBody): Response<DataContainer<String>>
@POST("outside/rooms/create-single-chat")
suspend fun createSingleChat(@Body body: SingleChatRequestBody): Response<DataContainer<Unit>>
}