@roadiehq/rag-ai
Version:
42 lines (35 loc) • 1.41 kB
TypeScript
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
import { IconComponent, DiscoveryApi, FetchApi, ConfigApi, IdentityApi } from '@backstage/core-plugin-api';
import * as React from 'react';
import { ParsedEvent } from 'eventsource-parser/stream';
type RagModalProps = {
title?: string;
hotkey?: string;
};
type SidebarRagModalProps = RagModalProps & {
icon?: IconComponent;
};
declare const ragAiPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
declare const RagModal: (props: RagModalProps) => React.JSX.Element;
declare const SidebarRagModal: ({ title, icon, ...props }: SidebarRagModalProps) => React.JSX.Element;
interface RagAiApi {
ask(question: string, source: string): AsyncGenerator<ParsedEvent>;
}
declare const ragAiApiRef: _backstage_core_plugin_api.ApiRef<RagAiApi>;
declare class RoadieRagAiClient implements RagAiApi {
private readonly discoveryApi;
private readonly fetchApi;
private readonly configApi;
private baseUrl?;
private readonly identityApi;
constructor(options: {
discoveryApi: DiscoveryApi;
fetchApi: FetchApi;
configApi: ConfigApi;
identityApi: IdentityApi;
});
private getBaseUrl;
private fetch;
ask(question: string, source: string): AsyncGenerator<ParsedEvent>;
}
export { RagModal, RoadieRagAiClient, SidebarRagModal, ragAiApiRef, ragAiPlugin };