Skip to content

Commit

Permalink
Fix file names
Browse files Browse the repository at this point in the history
  • Loading branch information
yansavitski committed Mar 7, 2024
1 parent ee31f01 commit 942c3c9
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/kbn-playground/public/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import { v4 as uuidv4 } from 'uuid';
import { i18n } from '@kbn/i18n';

import { ChatSidebar } from './chat_sidebar';
import { useChat } from '../hooks/useChat';
import { useChat } from '../hooks/use_chat';
import { ChatForm, ChatFormFields, MessageRole, SummarizationModelName } from '../../types';

import { MessageList } from './message_list/message_list';
import { QuestionInput } from './question_input';
import { StartNewChat } from './start_new_chat';

import { TelegramIcon } from './telegram_icon';
import { transformFromChatMessages } from '../utils/transformToMessages';
import { transformFromChatMessages } from '../utils/transform_to_messages';

export const Chat = () => {
const [showStartPage, setShowStartPage] = useState(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useState } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiComboBoxOptionOption } from '@elastic/eui/src/components/combo_box/types';
import { IndexName } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { useQueryIndices } from '../../hooks/useQueryIndices';
import { useQueryIndices } from '../../hooks/use_query_indices';

interface AddIndicesFieldProps {
selectedIndices: IndexName[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EuiButton, EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
import { useChatContext } from '../../hooks/useChatContext';
import { useChatContext } from '../../hooks/use_chat_context';

export const CreateIndexCallout: React.FC = () => {
const { navigateToIndexPage } = useChatContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { AddIndicesField } from './add_indices_field';
import { IndicesTable } from './indices_table';
import { StartChatPanel } from '../start_chat_panel';
import { CreateIndexCallout } from './create_index_callout';
import { useSourceIndicesField } from '../../hooks/useSourceIndicesField';
import { useQueryIndices } from '../../hooks/useQueryIndices';
import { useSourceIndicesField } from '../../hooks/use_source_indices_field';
import { useQueryIndices } from '../../hooks/use_query_indices';
import { ChatFormFields } from '../../../types';
import { useIndicesFields } from '../../hooks/useIndicesFields';
import { useIndicesFields } from '../../hooks/use_indices_fields';
import { createQuery, getDefaultQueryFields } from '../../utils/create_query';

export const SourcesPanelForStartChat: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiCallOut, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { useController } from 'react-hook-form';
import { useSourceIndicesField } from '../../hooks/useSourceIndicesField';
import { useIndicesFields } from '../../hooks/useIndicesFields';
import { useSourceIndicesField } from '../../hooks/use_source_indices_field';
import { useIndicesFields } from '../../hooks/use_indices_fields';
import { createQuery, getDefaultQueryFields } from '../../utils/create_query';
import { ChatFormFields } from '../../../types';
import { AddIndicesField } from './add_indices_field';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { FormattedMessage } from '@kbn/i18n-react';
import { AIPlaygroundPluginStartDeps } from '../../../types';
import { useCreateApiKeyQuery } from '../../hooks/useCreateApiKeyQuery';
import { useCreateApiKeyQuery } from '../../hooks/use_create_api_key_query';

enum ApiKeyFormFields {
Name = 'name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from '@elastic/eui';
import { useController, useFormContext } from 'react-hook-form';
import { ChatForm, ChatFormFields } from '../../../types';
import { useIndicesFields } from '../../hooks/useIndicesFields';
import { useIndicesFields } from '../../hooks/use_indices_fields';
import { createQuery, getDefaultQueryFields } from '../../utils/create_query';

export const ViewQueryAction: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { useKibana } from '@kbn/kibana-react-plugin/public';
import { useAIAssistChat } from './useAIAssistChat';
import { useAIAssistChat } from './use_ai_assist_chat';
import { AIPlaygroundPluginStartDeps, UseChatHelpers } from '../../types';

export const useChat = (): UseChatHelpers => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { AIMessage, Message, MessageRole, UseChatHelpers } from '../../types';
import { transformAnnotationToDoc } from './transformAnnotationToDoc';
import { transformAnnotationToDoc } from './transform_annotation_to_doc';

export const transformFromChatMessages = (messages: UseChatHelpers['messages']): Message[] =>
messages.map(({ id, content, createdAt, role, annotations }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-playground/server/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Logger } from '@kbn/logging';
import { IRouter, RequestHandler } from '@kbn/core/server';
import { fetchFields } from './utils/fetch_query_source_fields';
import { AssistClientOptionsWithClient, createAssist as Assist } from './utils/assist';
import { ConversationalChain } from './utils/conversationalChain';
import { ConversationalChain } from './utils/conversational_chain';
import { Prompt } from './utils/prompt';

export function registerPlaygroundRoutes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import {
experimental_StreamData,
Message as VercelChatMessage,
} from 'ai';
import { ElasticsearchRetriever } from './elasticsearchRetriever';
import { renderTemplate } from './renderTemplate';
import { ElasticsearchRetriever } from './elasticsearch_retriever';
import { renderTemplate } from './render_template';

import { AssistClient } from './assist';
import { getCitations } from './getCitations';
import { getCitations } from './get_citations';

interface RAGOptions {
index: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Document } from '@langchain/core/documents';
import { getCitations } from './getCitations';
import { getCitations } from './get_citations';

describe('getCitations', () => {
test('should enrich citations', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function getCitations(

return docs.filter((doc, i) => {
return gatheredCitations.some((citation) => {
return i + 1 === parseInt(citation.slice(1, -1));
return i + 1 === parseInt(citation.slice(1, -1), 10);
});
});
}

0 comments on commit 942c3c9

Please sign in to comment.