Skip to content

Commit

Permalink
ok the generator for a Response type is working
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed May 15, 2023
1 parent d48fb7c commit 282fd3c
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 129 deletions.
1 change: 0 additions & 1 deletion app/ResponseType/ResponseTypeEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ public function label(): string
};
}
}

234 changes: 107 additions & 127 deletions config/larachain.php
Original file line number Diff line number Diff line change
@@ -1,129 +1,109 @@
<?php

return array(
'sources' =>
array(
'web_file' =>
array(
'title' => 'Web File Source Type',
'description' => 'Points to one or more URLs to download files from the internet for later parsing. All configuration data is encrypted.',
'icon' => 'ArrowDownTrayIcon',
'background' => 'bg-indigo-500',
),
'web' =>
array(
'title' => 'Scrape a Web Page',
'description' => 'Simple scraper to fetch the desired data from a web page and pass it to LLM.',
'icon' => 'Bars4Icon',
'background' => 'bg-sky-500',
),
'web_hook' =>
array(
'title' => 'Create a Webhook to Send Data',
'description' => 'Add a webhook here to send logs or other data.',
'icon' => 'Bars4Icon',
'background' => 'bg-sky-500',
),
's3_directory' =>
array(
'title' => 'S3 Directory to Get Files From',
'description' => 'Retrieve files from an S3 directory.',
'icon' => 'Bars4Icon',
'background' => 'bg-red-500',
),
),
'transformers' =>
array(
'pdf_transformer' =>
array(
'title' => 'Break Pages of PDF into Text and Document Chunks',
'description' => 'If you have a PDF as a source, use this transformer to extract pages and text.',
'icon' => 'DocumentIcon',
'background' => 'bg-blue-500',
),
'embed_transformer' =>
array(
'title' => 'Vectorize Your Data',
'description' => 'Create embeddings out of all your document chunks.',
'icon' => 'ArrowsRightLeftIcon',
'background' => 'bg-red-700',
),
),
'outbounds' =>
array(
'chat_ui' =>
array(
'title' => 'Add a ChatUI to the Project Page',
'description' => 'Users can use the chosen Chat LLM to interact with the related data.',
'icon' => 'ChatBubbleLeftIcon',
'background' => 'bg-sky-500',
),
'api' =>
array(
'title' => 'Add an API',
'description' => 'Attach a secure API to communicate with your data from any other app.',
'icon' => 'PhoneIcon',
'background' => 'bg-green-500',
),
),
'response_types' =>
array(
'embed_question' =>
array(
'title' => 'Convert Incoming Question/Request into an Embedding',
'description' => 'This allows you to search the vector database if you have vectorized your data.',
'icon' => 'MegaphoneIcon',
'route' => 'embed_question',
'requires' =>
array(
0 => 'transformers:embed_transformer',
),
'background' => 'bg-sky-500',
'active' => 1,
),
'vector_search' =>
array(
'title' => 'Search Vector Database',
'description' => 'Search the vector database with your request and pass it on to the next response type or to the user',
'icon' => 'MagnifyingGlassIcon',
'route' => 'vector_search',
'requires' =>
array(
0 => 'embed_question',
),
'background' => 'bg-green-500',
'active' => 1,
),
'combine_content' =>
array(
'title' => 'Combine Content',
'description' => 'This will merge together the document chunks that result from a search to make sure they fit in a prompt',
'icon' => 'ArrowsPointingInIcon',
'route' => 'combine_content',
'requires' =>
array(
0 => 'embed_question',
),
'background' => 'bg-slate-800',
'active' => 1,
),
'trim_text' =>
array(
'title' => 'Trim Text',
'description' => 'designed to help you trim text inputs, making it easier to fit more content within GPT’s context window. By tokenizing, stemming, and removing spaces, this library prepares your text inputs for efficient processing with GPT models.',
'icon' => 'DocumentTextIcon',
'route' => 'trim_text',
'background' => 'bg-slate-800',
'active' => 1,
),
'chat_ui' =>
array(
'title' => 'Integrate with Chat LLM APIs',
'description' => 'Create a chat system with platforms like OpenAI or others. It will pass any info into the {context} token in the prompt_token',
'icon' => 'ChatBubbleLeftIcon',
'route' => 'chat_ui',
'background' => 'bg-pink-400',
'active' => 1,
),
),
);
return [
'sources' => [
'web_file' => [
'title' => 'Web File Source Type',
'description' => 'Points to one or more URLs to download files from the internet for later parsing. All configuration data is encrypted.',
'icon' => 'ArrowDownTrayIcon',
'background' => 'bg-indigo-500',
],
'web' => [
'title' => 'Scrape a Web Page',
'description' => 'Simple scraper to fetch the desired data from a web page and pass it to LLM.',
'icon' => 'Bars4Icon',
'background' => 'bg-sky-500',
],
'web_hook' => [
'title' => 'Create a Webhook to Send Data',
'description' => 'Add a webhook here to send logs or other data.',
'icon' => 'Bars4Icon',
'background' => 'bg-sky-500',
],
's3_directory' => [
'title' => 'S3 Directory to Get Files From',
'description' => 'Retrieve files from an S3 directory.',
'icon' => 'Bars4Icon',
'background' => 'bg-red-500',
],
],
'transformers' => [
'pdf_transformer' => [
'title' => 'Break Pages of PDF into Text and Document Chunks',
'description' => 'If you have a PDF as a source, use this transformer to extract pages and text.',
'icon' => 'DocumentIcon',
'background' => 'bg-blue-500',
],
'embed_transformer' => [
'title' => 'Vectorize Your Data',
'description' => 'Create embeddings out of all your document chunks.',
'icon' => 'ArrowsRightLeftIcon',
'background' => 'bg-red-700',
],
],
'outbounds' => [
'chat_ui' => [
'title' => 'Add a ChatUI to the Project Page',
'description' => 'Users can use the chosen Chat LLM to interact with the related data.',
'icon' => 'ChatBubbleLeftIcon',
'background' => 'bg-sky-500',
],
'api' => [
'title' => 'Add an API',
'description' => 'Attach a secure API to communicate with your data from any other app.',
'icon' => 'PhoneIcon',
'background' => 'bg-green-500',
],
],
'response_types' => [
'embed_question' => [
'title' => 'Convert Incoming Question/Request into an Embedding',
'description' => 'This allows you to search the vector database if you have vectorized your data.',
'icon' => 'MegaphoneIcon',
'route' => 'embed_question',
'requires' => [
0 => 'transformers:embed_transformer',
],
'background' => 'bg-sky-500',
'active' => 1,
],
'vector_search' => [
'title' => 'Search Vector Database',
'description' => 'Search the vector database with your request and pass it on to the next response type or to the user',
'icon' => 'MagnifyingGlassIcon',
'route' => 'vector_search',
'requires' => [
0 => 'embed_question',
],
'background' => 'bg-green-500',
'active' => 1,
],
'combine_content' => [
'title' => 'Combine Content',
'description' => 'This will merge together the document chunks that result from a search to make sure they fit in a prompt',
'icon' => 'ArrowsPointingInIcon',
'route' => 'combine_content',
'requires' => [
0 => 'embed_question',
],
'background' => 'bg-slate-800',
'active' => 1,
],
'trim_text' => [
'title' => 'Trim Text',
'description' => 'designed to help you trim text inputs, making it easier to fit more content within GPT’s context window. By tokenizing, stemming, and removing spaces, this library prepares your text inputs for efficient processing with GPT models.',
'icon' => 'DocumentTextIcon',
'route' => 'trim_text',
'background' => 'bg-slate-800',
'active' => 1,
],
'chat_ui' => [
'title' => 'Integrate with Chat LLM APIs',
'description' => 'Create a chat system with platforms like OpenAI or others. It will pass any info into the {context} token in the prompt_token',
'icon' => 'ChatBubbleLeftIcon',
'route' => 'chat_ui',
'background' => 'bg-pink-400',
'active' => 1,
],
],
];
2 changes: 1 addition & 1 deletion tests/Feature/EnumTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum ResponseTypeEnum: string
$this->assertStringContainsString("case FooBar = 'foo_bar'", $content);
$this->assertStringContainsString("case EmbedQuestion = 'embed_question'", $content);
$this->assertStringContainsString('enum ResponseTypeEnum: string', $content);
$this->assertEquals(1, substr_count($content, "case FooBar"));
$this->assertEquals(1, substr_count($content, 'case FooBar'));

return true;
});
Expand Down

0 comments on commit 282fd3c

Please sign in to comment.