import type { Fetcher } from 'swr' import { get, post } from './base' import type { AnnotationsCountResponse, ChatConversationFullDetailResponse, ChatConversationsRequest, ChatConversationsResponse, ChatMessagesRequest, ChatMessagesResponse, CompletionConversationFullDetailResponse, CompletionConversationsRequest, CompletionConversationsResponse, ConversationListResponse, LogMessageAnnotationsRequest, LogMessageAnnotationsResponse, LogMessageFeedbacksRequest, LogMessageFeedbacksResponse, } from '@/models/log' export const fetchConversationList: Fetcher }> = ({ appId, params }) => { return get(`/console/api/apps/${appId}/messages`, params) } // (Text Generation Application) Session List export const fetchCompletionConversations: Fetcher = ({ url, params }) => { return get(url, { params }) } // (Text Generation Application) Session Detail export const fetchCompletionConversationDetail: Fetcher = ({ url }) => { return get(url, {}) } // (Chat Application) Session List export const fetchChatConversations: Fetcher = ({ url, params }) => { return get(url, { params }) } // (Chat Application) Session Detail export const fetchChatConversationDetail: Fetcher = ({ url }) => { return get(url, {}) } // (Chat Application) Message list in one session export const fetchChatMessages: Fetcher = ({ url, params }) => { return get(url, { params }) } export const updateLogMessageFeedbacks: Fetcher = ({ url, body }) => { return post(url, { body }) } export const updateLogMessageAnnotations: Fetcher = ({ url, body }) => { return post(url, { body }) } export const fetchAnnotationsCount: Fetcher = ({ url }) => { return get(url) }