44
55``` ts
66
7- /// <reference types = " react" />
8-
9- import { AlertProps } from ' @patternfly/react-core' ;
10- import { ApiRef } from ' @backstage/core-plugin-api' ;
117import { BackstagePlugin } from ' @backstage/core-plugin-api' ;
12- import { ChatbotDisplayMode } from ' @patternfly/chatbot' ;
13- import { ConfigApi } from ' @backstage/core-plugin-api' ;
14- import { FetchApi } from ' @backstage/core-plugin-api' ;
158import { JSX as JSX_2 } from ' react/jsx-runtime' ;
169import { PathParams } from ' @backstage/core-plugin-api' ;
1710import { PropsWithChildren } from ' react' ;
1811import { RouteRef } from ' @backstage/core-plugin-api' ;
19- import { SourcesCardProps } from ' @patternfly/chatbot' ;
2012import { SubRouteRef } from ' @backstage/core-plugin-api' ;
2113
22- // @public
23- export type Attachment = {
24- attachment_type: string ;
25- content_type: string ;
26- content: string ;
27- };
28-
29- // @public
30- export interface BaseMessage {
31- // (undocumented)
32- content: string ;
33- // (undocumented)
34- error? : AlertProps ;
35- // (undocumented)
36- id: number ;
37- // (undocumented)
38- model: string ;
39- // (undocumented)
40- name: string ;
41- // (undocumented)
42- referenced_documents? : ReferencedDocuments ;
43- // (undocumented)
44- sources? : SourcesCardProps ;
45- // (undocumented)
46- timestamp: string ;
47- // (undocumented)
48- type: string ;
49- }
50-
51- // @public
52- export type CaptureFeedback = {
53- conversation_id: string ;
54- user_question: string ;
55- llm_response: string ;
56- user_feedback: string ;
57- sentiment: number ;
58- };
59-
60- // @public
61- export type ConversationList = ConversationSummary [];
62-
63- // @public
64- export type ConversationSummary = {
65- conversation_id: string ;
66- last_message_timestamp: number ;
67- topic_summary: string ;
68- };
69-
7014// @public
7115export type DrawerState = {
7216 id: string ;
@@ -81,100 +25,9 @@ export type DrawerStateExposerProps = {
8125 onStateChange: (state : DrawerState ) => void ;
8226};
8327
84- // @public
85- export interface LCSModel {
86- // (undocumented)
87- api_model_type: LCSModelApiModelType ;
88- // (undocumented)
89- identifier: string ;
90- // (undocumented)
91- metadata: {
92- embedding_dimension: number ;
93- };
94- // (undocumented)
95- model_type: LCSModelType ;
96- // (undocumented)
97- provider_id: string ;
98- // (undocumented)
99- provider_resource_id: string ;
100- // (undocumented)
101- type: ' model' ;
102- }
103-
104- // @public
105- export type LCSModelApiModelType = ' embedding' | ' llm' ;
106-
107- // @public
108- export type LCSModelType = ' embedding' | ' llm' ;
109-
110- // @public
111- export type LightspeedAPI = {
112- getAllModels: () => Promise <LCSModel []>;
113- getConversationMessages: (conversation_id : string ) => Promise <BaseMessage []>;
114- createMessage: (prompt : string , selectedModel : string , selectedProvider : string , conversation_id : string , attachments : Attachment []) => Promise <ReadableStreamDefaultReader >;
115- deleteConversation: (conversation_id : string ) => Promise <{
116- success: boolean ;
117- }>;
118- renameConversation: (conversation_id : string , newName : string ) => Promise <{
119- success: boolean ;
120- }>;
121- getConversations: () => Promise <ConversationList >;
122- getFeedbackStatus: () => Promise <boolean >;
123- captureFeedback: (payload : CaptureFeedback ) => Promise <{
124- response: string ;
125- }>;
126- isTopicRestrictionEnabled: () => Promise <boolean >;
127- };
128-
129- // @public
130- export class LightspeedApiClient implements LightspeedAPI {
131- constructor (options : Options );
132- // (undocumented)
133- captureFeedback: (payload : CaptureFeedback ) => Promise <any >;
134- // (undocumented)
135- createMessage(prompt : string , selectedModel : string , selectedProvider : string , conversation_id : string , attachments : Attachment []): Promise <ReadableStreamDefaultReader <Uint8Array >>;
136- // (undocumented)
137- deleteConversation(conversation_id : string ): Promise <{
138- success: boolean ;
139- }>;
140- // (undocumented)
141- getAllModels(): Promise <any >;
142- // (undocumented)
143- getBaseUrl(): Promise <string >;
144- // (undocumented)
145- getConversationMessages(conversation_id : string ): Promise <any >;
146- // (undocumented)
147- getConversations(): Promise <any >;
148- // (undocumented)
149- getFeedbackStatus: () => Promise <any >;
150- // (undocumented)
151- isTopicRestrictionEnabled(): Promise <any >;
152- // (undocumented)
153- renameConversation(conversation_id : string , newName : string ): Promise <{
154- success: boolean ;
155- }>;
156- }
157-
158- // @public
159- export const lightspeedApiRef: ApiRef <LightspeedAPI >;
160-
16128// @public (undocumented)
16229export const LightspeedChatContainer: () => JSX_2 .Element ;
16330
164- // @public
165- export interface LightspeedDrawerContextType {
166- currentConversationId? : string ;
167- displayMode: ChatbotDisplayMode ;
168- draftMessage: string ;
169- drawerWidth: number ;
170- isChatbotActive: boolean ;
171- setCurrentConversationId: (id : string | undefined ) => void ;
172- setDisplayMode: (mode : ChatbotDisplayMode ) => void ;
173- setDraftMessage: (message : string ) => void ;
174- setDrawerWidth: React .Dispatch <React .SetStateAction <number >>;
175- toggleChatbot: () => void ;
176- }
177-
17831// @public
17932export const LightspeedDrawerProvider: React .ComponentType <PropsWithChildren >;
18033
@@ -184,9 +37,6 @@ export const LightspeedDrawerStateExposer: ({ onStateChange, }: DrawerStateExpos
18437// @public
18538export const LightspeedFAB: () => JSX_2 .Element | null ;
18639
187- // @public
188- export const LightspeedFABIcon: () => JSX_2 .Element ;
189-
19040// @public
19141export const LightspeedIcon: () => JSX_2 .Element ;
19242
@@ -199,25 +49,6 @@ root: RouteRef<undefined>;
19949lightspeedConversation: SubRouteRef <PathParams <" /conversation/:conversationId" >>;
20050}, {}, {}>;
20151
202- // @public
203- export type Options = {
204- configApi: ConfigApi ;
205- fetchApi: FetchApi ;
206- };
207-
208- // @public
209- export type ReferencedDocument = {
210- doc_title: string ;
211- doc_url: string ;
212- doc_description? : string ;
213- };
214-
215- // @public
216- export type ReferencedDocuments = ReferencedDocument [];
217-
218- // @public
219- export const useLightspeedDrawerContext: () => LightspeedDrawerContextType ;
220-
22152// (No @packageDocumentation comment for this package)
22253
22354```
0 commit comments