@harnessio/react-intelligence-service-client 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/intelligence-service/src/services/hooks/useCreateChatFeedbackMutation.d.ts +26 -0
- package/dist/intelligence-service/src/services/hooks/useCreateChatFeedbackMutation.js +14 -0
- package/dist/intelligence-service/src/services/hooks/useListChatSessionsQuery.d.ts +1 -0
- package/dist/intelligence-service/src/services/index.d.ts +5 -0
- package/dist/intelligence-service/src/services/index.js +1 -0
- package/dist/intelligence-service/src/services/schemas/EnumFeedbackReason.d.ts +1 -0
- package/dist/intelligence-service/src/services/schemas/EnumFeedbackReason.js +4 -0
- package/dist/intelligence-service/src/services/schemas/EnumSentiment.d.ts +1 -0
- package/dist/intelligence-service/src/services/schemas/EnumSentiment.js +4 -0
- package/dist/intelligence-service/src/services/schemas/TypesChatFeedbackInput.d.ts +23 -0
- package/dist/intelligence-service/src/services/schemas/TypesChatFeedbackInput.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { UsererrorError } from '../schemas/UsererrorError';
|
|
3
|
+
import type { TypesChatFeedbackInput } from '../schemas/TypesChatFeedbackInput';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface CreateChatFeedbackMutationQueryParams {
|
|
7
|
+
orgIdentifier?: string;
|
|
8
|
+
projectIdentifier?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateChatFeedbackMutationHeaderParams {
|
|
11
|
+
'harness-account': string;
|
|
12
|
+
}
|
|
13
|
+
export type CreateChatFeedbackRequestBody = TypesChatFeedbackInput;
|
|
14
|
+
export type CreateChatFeedbackOkResponse = ResponseWithPagination<{
|
|
15
|
+
message?: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type CreateChatFeedbackErrorResponse = UsererrorError;
|
|
18
|
+
export interface CreateChatFeedbackProps extends Omit<FetcherOptions<CreateChatFeedbackMutationQueryParams, CreateChatFeedbackRequestBody, CreateChatFeedbackMutationHeaderParams>, 'url'> {
|
|
19
|
+
queryParams: CreateChatFeedbackMutationQueryParams;
|
|
20
|
+
body: CreateChatFeedbackRequestBody;
|
|
21
|
+
}
|
|
22
|
+
export declare function createChatFeedback(props: CreateChatFeedbackProps): Promise<CreateChatFeedbackOkResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Submit feedback for a chat interaction
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCreateChatFeedbackMutation(options?: Omit<UseMutationOptions<CreateChatFeedbackOkResponse, CreateChatFeedbackErrorResponse, CreateChatFeedbackProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateChatFeedbackOkResponse, UsererrorError, CreateChatFeedbackProps, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useMutation } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function createChatFeedback(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/chat/feedback`, method: 'POST' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Submit feedback for a chat interaction
|
|
11
|
+
*/
|
|
12
|
+
export function useCreateChatFeedbackMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => createChatFeedback(mutateProps), options);
|
|
14
|
+
}
|
|
@@ -7,6 +7,8 @@ export type { CompleteAttachmentErrorResponse, CompleteAttachmentMutationPathPar
|
|
|
7
7
|
export { completeAttachment, useCompleteAttachmentMutation, } from './hooks/useCompleteAttachmentMutation';
|
|
8
8
|
export type { CreateAccountRuleErrorResponse, CreateAccountRuleOkResponse, CreateAccountRuleProps, CreateAccountRuleRequestBody, } from './hooks/useCreateAccountRuleMutation';
|
|
9
9
|
export { createAccountRule, useCreateAccountRuleMutation, } from './hooks/useCreateAccountRuleMutation';
|
|
10
|
+
export type { CreateChatFeedbackErrorResponse, CreateChatFeedbackMutationQueryParams, CreateChatFeedbackOkResponse, CreateChatFeedbackProps, CreateChatFeedbackRequestBody, } from './hooks/useCreateChatFeedbackMutation';
|
|
11
|
+
export { createChatFeedback, useCreateChatFeedbackMutation, } from './hooks/useCreateChatFeedbackMutation';
|
|
10
12
|
export type { CreateEntityErrorResponse, CreateEntityOkResponse, CreateEntityProps, CreateEntityRequestBody, } from './hooks/useCreateEntityMutation';
|
|
11
13
|
export { createEntity, useCreateEntityMutation } from './hooks/useCreateEntityMutation';
|
|
12
14
|
export type { CreateOrgRuleErrorResponse, CreateOrgRuleMutationPathParams, CreateOrgRuleOkResponse, CreateOrgRuleProps, CreateOrgRuleRequestBody, } from './hooks/useCreateOrgRuleMutation';
|
|
@@ -67,9 +69,11 @@ export type { ControllerRuleInput } from './schemas/ControllerRuleInput';
|
|
|
67
69
|
export type { EnumAction } from './schemas/EnumAction';
|
|
68
70
|
export type { EnumAgentMode } from './schemas/EnumAgentMode';
|
|
69
71
|
export type { EnumEntityType } from './schemas/EnumEntityType';
|
|
72
|
+
export type { EnumFeedbackReason } from './schemas/EnumFeedbackReason';
|
|
70
73
|
export type { EnumMessageType } from './schemas/EnumMessageType';
|
|
71
74
|
export type { EnumRequestAction } from './schemas/EnumRequestAction';
|
|
72
75
|
export type { EnumRole } from './schemas/EnumRole';
|
|
76
|
+
export type { EnumSentiment } from './schemas/EnumSentiment';
|
|
73
77
|
export type { HandlerGetSessionResponse } from './schemas/HandlerGetSessionResponse';
|
|
74
78
|
export type { OpenapiRuleCategoriesResponse } from './schemas/OpenapiRuleCategoriesResponse';
|
|
75
79
|
export type { TypesAttachmentCompleteRequest } from './schemas/TypesAttachmentCompleteRequest';
|
|
@@ -79,6 +83,7 @@ export type { TypesAttachmentReadyResponse } from './schemas/TypesAttachmentRead
|
|
|
79
83
|
export type { TypesAttachmentRef } from './schemas/TypesAttachmentRef';
|
|
80
84
|
export type { TypesAttachmentStatus } from './schemas/TypesAttachmentStatus';
|
|
81
85
|
export type { TypesChat } from './schemas/TypesChat';
|
|
86
|
+
export type { TypesChatFeedbackInput } from './schemas/TypesChatFeedbackInput';
|
|
82
87
|
export type { TypesChatMessage } from './schemas/TypesChatMessage';
|
|
83
88
|
export type { TypesChatMessageV2 } from './schemas/TypesChatMessageV2';
|
|
84
89
|
export type { TypesChatOutput } from './schemas/TypesChatOutput';
|
|
@@ -2,6 +2,7 @@ export { chat, useChatMutation } from './hooks/useChatMutation';
|
|
|
2
2
|
export { chatV2, useChatV2Mutation } from './hooks/useChatV2Mutation';
|
|
3
3
|
export { completeAttachment, useCompleteAttachmentMutation, } from './hooks/useCompleteAttachmentMutation';
|
|
4
4
|
export { createAccountRule, useCreateAccountRuleMutation, } from './hooks/useCreateAccountRuleMutation';
|
|
5
|
+
export { createChatFeedback, useCreateChatFeedbackMutation, } from './hooks/useCreateChatFeedbackMutation';
|
|
5
6
|
export { createEntity, useCreateEntityMutation } from './hooks/useCreateEntityMutation';
|
|
6
7
|
export { createOrgRule, useCreateOrgRuleMutation } from './hooks/useCreateOrgRuleMutation';
|
|
7
8
|
export { createProjectRule, useCreateProjectRuleMutation, } from './hooks/useCreateProjectRuleMutation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EnumFeedbackReason = 'did_not_fully_follow_instructions' | 'incorrect_yaml' | 'performance_issues' | 'response_not_accurate' | 'response_was_not_helpful';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EnumSentiment = 'negative' | 'positive';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { UuidUuid } from '../schemas/UuidUuid';
|
|
2
|
+
import type { EnumFeedbackReason } from '../schemas/EnumFeedbackReason';
|
|
3
|
+
import type { EnumSentiment } from '../schemas/EnumSentiment';
|
|
4
|
+
export interface TypesChatFeedbackInput {
|
|
5
|
+
/**
|
|
6
|
+
* Optional comment providing additional feedback details
|
|
7
|
+
*/
|
|
8
|
+
comment?: string;
|
|
9
|
+
conversation_id: UuidUuid;
|
|
10
|
+
interaction_id: UuidUuid;
|
|
11
|
+
/**
|
|
12
|
+
* List of reasons for the feedback (required for negative sentiment)
|
|
13
|
+
*/
|
|
14
|
+
reasons?: EnumFeedbackReason[];
|
|
15
|
+
/**
|
|
16
|
+
* User sentiment (positive or negative)
|
|
17
|
+
*/
|
|
18
|
+
sentiment: EnumSentiment;
|
|
19
|
+
/**
|
|
20
|
+
* Session identifier
|
|
21
|
+
*/
|
|
22
|
+
session_id: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED