diff --git a/Modules/TagFunction/app/TagManager.php b/Modules/TagFunction/app/TagManager.php index 2ff46124..2dae86ad 100644 --- a/Modules/TagFunction/app/TagManager.php +++ b/Modules/TagFunction/app/TagManager.php @@ -2,7 +2,6 @@ namespace LlmLaraHub\TagFunction; -use App\Domains\Collections\CollectionStatusEnum; use App\Models\Document; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; diff --git a/app/Http/Controllers/DeleteDocumentsController.php b/app/Http/Controllers/DeleteDocumentsController.php index 7f9bb7c1..28d6ecb6 100644 --- a/app/Http/Controllers/DeleteDocumentsController.php +++ b/app/Http/Controllers/DeleteDocumentsController.php @@ -31,15 +31,17 @@ public function delete() return back(); } - public function deleteAll(Collection $collection) { + public function deleteAll(Collection $collection) + { - foreach($collection->documents as $document) { + foreach ($collection->documents as $document) { $document->document_chunks()->delete(); $document->tags()->delete(); $document->delete(); } request()->session()->flash('flash.banner', 'Deleted all Documents'); + return back(); } } diff --git a/app/Http/Controllers/DocumentController.php b/app/Http/Controllers/DocumentController.php index fc6c7640..393beba2 100644 --- a/app/Http/Controllers/DocumentController.php +++ b/app/Http/Controllers/DocumentController.php @@ -5,18 +5,18 @@ use App\Http\Resources\DocumentResource; use App\Http\Resources\DocumentResourceWithPaginate; use App\Models\Collection; -use Illuminate\Http\Request; class DocumentController extends Controller { - public function index(Collection $collection) { + public function index(Collection $collection) + { $filter = request()->get('filter'); if ($filter) { $documents = $collection->documents() ->where('status', '=', $filter)->paginate(100); - } else { + } else { $documents = $collection->documents()->paginate(100); } @@ -25,7 +25,8 @@ public function index(Collection $collection) { ]); } - public function status(Collection $collection) { + public function status(Collection $collection) + { return response()->json([ 'documents' => DocumentResource::collection($collection->documents), diff --git a/app/Jobs/DocumentProcessingCompleteJob.php b/app/Jobs/DocumentProcessingCompleteJob.php index 1349868e..768180ca 100644 --- a/app/Jobs/DocumentProcessingCompleteJob.php +++ b/app/Jobs/DocumentProcessingCompleteJob.php @@ -21,7 +21,7 @@ class DocumentProcessingCompleteJob implements ShouldQueue */ public function __construct(public Document $document) { - $this->onQueue("default"); + $this->onQueue('default'); } /** diff --git a/tests/Feature/Http/Controllers/DocumentControllerTest.php b/tests/Feature/Http/Controllers/DocumentControllerTest.php index e51303fd..5fd8f567 100644 --- a/tests/Feature/Http/Controllers/DocumentControllerTest.php +++ b/tests/Feature/Http/Controllers/DocumentControllerTest.php @@ -2,8 +2,6 @@ namespace Tests\Feature\Http\Controllers; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Foundation\Testing\WithFaker; use Tests\TestCase; class DocumentControllerTest extends TestCase diff --git a/tests/fixtures/after_mapping.json b/tests/fixtures/after_mapping.json index 04194555..65fd9183 100644 --- a/tests/fixtures/after_mapping.json +++ b/tests/fixtures/after_mapping.json @@ -1,10 +1,18 @@ [ { - "content": "how would I go about \"negotiating media buys\"", + "content": "test", + "role": "assistant" + }, + { + "content": "test", "role": "user" }, { - "content": "**Role**\nA Summarization and Prompt Answering system that sticks to the context in this prompt.\n**Task**\nUsing the context of the prompt and the users query return a concise, clear, and accurate response.\n**Format**\nDeliver the response in a concise, clear Markdown format (Text). Use quotes as needed from the context.\n\n[DO NOT INCLUDE THE ABOVE IN THE RESPONSE]\n\n**The User's Query**:\n```how would I go about \"negotiating media buys\"```\n\n**Context from the database search of documents for Response**:\n```category: ABOUT THE AGENCY\noriginal_question: AGENCY HISTORY\nresponses: Firehouse celebrated its twentieth anniversary in 2017. Founded by Mark Hall, the agency focused on promotional and below the line work for the better part of its first decade. Beginning in 2016, Firehouse made a series of hires to enable the agency to solve bigger problems and handle larger client businesses. Today, we are the agency of record for most of our clients, many of whom have a national footprint. \n3: \n4: category: ABOUT THE AGENCY\noriginal_question: CAPABILITIES OVERVIEW\nresponses: We operate at the intersection of a consultancy and creative boutique. We believe getting to insights - a true understanding not just of the \"what's\" but the \"why's\" - is the genesis of all good ideas. Because of this, our core competencies are strategy, creative development, and media planning. All other capabilities including research, SEO\/SEM, social media, account and project management and analytics stem from those sources. We would partner with outside specialists (whom we are likely to have worked previously) se sources. We would partner with outside specialists (whom we are likely to have worked previously) to assist with Spanish language research, cultural understanding and copywriting. This is an approach we have employed successfully for Stripes Convenience Stores, Interstate Batteries and other clients. \n3: \n4: category: ABOUT THE AGENCY\noriginal_question: CAPABILITIES OVERVIEW\nresponses: We operate at the intersection of a consultancy and creative boutique. We believe getting to insights - a true understanding not just of the \"what's\" but the \"why's\" - is the genesis of all good ideas. Because of this, our core competencies are strategy, creative development, and media planning. All other capabilities including research, SEO\/SEM, social media, account and project management and analytics stem from those sources. We would partner with outside specialists (whom we are likely to have worked previously) se sources. We would partner with outside specialists (whom we are likely to have worked previously) to assist with Spanish language research, cultural understanding and copywriting. This is an approach we have employed successfully for Stripes Convenience Stores, Interstate Batteries and other clients. \n3: \n4: category: ABOUT THE AGENCY\noriginal_question: AGENCY DIFFERENTIATORS\n\nWHAT DO YOU HAVE, OR WHAT DO YOU DO, THAT YOUR COMPETITORS DONT?\nresponses: Our people. Our culture. And our clients.\nFirehouse has been built on the shoulders of a great team that works exceptionally well together. The credit for any success weve achieved belongs to them.\nOur culture makes Firehouse sticky. Its why we beat the industry averages for both employee and client retention. Its why people stay late to drink wine in the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is s the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is so strong.\nFinally, the relationships we have with our clients are built on trust and transparency. We still believe in the value of a handshake, keeping our word and, above all, continually asking ourselves, whats the right thing to do? not what is most expedient, politically savvy or lines our bank account. \nThe incredible results we get for our clients are never an accident. Theyre the product of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execu category: ABOUT THE AGENCY\noriginal_question: AGENCY DIFFERENTIATORS\n\nWHAT DO YOU HAVE, OR WHAT DO YOU DO, THAT YOUR COMPETITORS DONT?\nresponses: Our people. Our culture. And our clients.\nFirehouse has been built on the shoulders of a great team that works exceptionally well together. The credit for any success weve achieved belongs to them.\nOur culture makes Firehouse sticky. Its why we beat the industry averages for both employee and client retention. Its why people stay late to drink wine in the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is s the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is so strong.\nFinally, the relationships we have with our clients are built on trust and transparency. We still believe in the value of a handshake, keeping our word and, above all, continually asking ourselves, whats the right thing to do? not what is most expedient, politically savvy or lines our bank account. \nThe incredible results we get for our clients are never an accident. Theyre the product of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execu of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execution. \n3: Team Leadership\nAs your AOR, we see ourselves as the primary stewards of your brand and its adherence to a consistent brand strategy. We would guide your internal teams and other agency partners to common goals and shared expressions of the brand. \n\nAs AOR, we would also help to streamline communication, align marketing efforts based on an annual plan, and ensure consistency across all touchpoints. We would have regular, ongoing conversations with the other partners, keeping them infor the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is so strong.\nFinally, the relationships we have with our clients are built on trust and transparency. We still believe in the value of a handshake, keeping our word and, above all, continually asking ourselves, whats the right thing to do? not what is most expedient, politically savvy or lines our bank account. \nThe incredible results we get for our clients are never an accident. Theyre the product of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execu of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execution. \n3: Team Leadership\nAs your AOR, we see ourselves as the primary stewards of your brand and its adherence to a consistent brand strategy. We would guide your internal teams and other agency partners to common goals and shared expressions of the brand. \n\nAs AOR, we would also help to streamline communication, align marketing efforts based on an annual plan, and ensure consistency across all touchpoints. We would have regular, ongoing conversations with the other partners, keeping them infor ouchpoints. We would have regular, ongoing conversations with the other partners, keeping them informed of plans or changes and linking arms to collaborate as needed. \n\nRight Size\nYour business would fit nicely in our portfolio of clients, being neither large enough to swamp the boat or small enough not to warrant our full attention. Weve always believed in scaling to meet client needs. Should your account require staff not currently in residence, we would grow to meet that demand. And, we stay close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execution. \n3: Team Leadership\nAs your AOR, we see ourselves as the primary stewards of your brand and its adherence to a consistent brand strategy. We would guide your internal teams and other agency partners to common goals and shared expressions of the brand. \n\nAs AOR, we would also help to streamline communication, align marketing efforts based on an annual plan, and ensure consistency across all touchpoints. We would have regular, ongoing conversations with the other partners, keeping them infor ouchpoints. We would have regular, ongoing conversations with the other partners, keeping them informed of plans or changes and linking arms to collaborate as needed. \n\nRight Size\nYour business would fit nicely in our portfolio of clients, being neither large enough to swamp the boat or small enough not to warrant our full attention. Weve always believed in scaling to meet client needs. Should your account require staff not currently in residence, we would grow to meet that demand. And, we stay close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe have all the capabilities you are seeking under one roof. And we believe that is more important today than ever. You cant afford for your marketing mix not to work in concert; message and medium need perfect orchestration. In fact, the work we were most awarded for this year all shared a common quality: an inseparable marriage of medium and message that achieved exponential effectiveness.\n\nAccountability\nAccountability is a big word for us. We believe we are only successful when our clients suc ouchpoints. We would have regular, ongoing conversations with the other partners, keeping them informed of plans or changes and linking arms to collaborate as needed. \n\nRight Size\nYour business would fit nicely in our portfolio of clients, being neither large enough to swamp the boat or small enough not to warrant our full attention. Weve always believed in scaling to meet client needs. Should your account require staff not currently in residence, we would grow to meet that demand. And, we stay close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe have all the capabilities you are seeking under one roof. And we believe that is more important today than ever. You cant afford for your marketing mix not to work in concert; message and medium need perfect orchestration. In fact, the work we were most awarded for this year all shared a common quality: an inseparable marriage of medium and message that achieved exponential effectiveness.\n\nAccountability\nAccountability is a big word for us. We believe we are only successful when our clients suc tability\nAccountability is a big word for us. We believe we are only successful when our clients succeed. We are diligent about campaign reporting, optimization and continual improvement to ensure we hit your KPIs. We also believe that part of being accountable is having and expressing a POV on the right thing to do for your brand. Not what is expedient, politically opportunistic or financially advantageous to the agency.\n\nPassion\nWe do our best work for brands we believe in. Lennox Residential would be an ideal client for us because its a brand with great products and consumer goodwill. Youre```", + "content": "test should not be last", "role": "assistant" + }, + { + "role": "user", + "content": "Using the surrounding context to continue this response thread" } ] \ No newline at end of file diff --git a/tests/fixtures/before_mapping.json b/tests/fixtures/before_mapping.json index d62c40a7..4bf7a9e0 100644 --- a/tests/fixtures/before_mapping.json +++ b/tests/fixtures/before_mapping.json @@ -1,13 +1,20 @@ [ { - "content": "how would I go about \"negotiating media buys\"", + "content": "test", + "role": "system", + "is_ai": false, + "show": true, + "meta_data": null + }, + { + "content": "test", "role": "user", "is_ai": false, "show": true, "meta_data": null }, { - "content": "**Role**\nA Summarization and Prompt Answering system that sticks to the context in this prompt.\n**Task**\nUsing the context of the prompt and the users query return a concise, clear, and accurate response.\n**Format**\nDeliver the response in a concise, clear Markdown format (Text). Use quotes as needed from the context.\n\n[DO NOT INCLUDE THE ABOVE IN THE RESPONSE]\n\n**The User's Query**:\n```how would I go about \"negotiating media buys\"```\n\n**Context from the database search of documents for Response**:\n```category: ABOUT THE AGENCY\noriginal_question: AGENCY HISTORY\nresponses: Firehouse celebrated its twentieth anniversary in 2017. Founded by Mark Hall, the agency focused on promotional and below the line work for the better part of its first decade. Beginning in 2016, Firehouse made a series of hires to enable the agency to solve bigger problems and handle larger client businesses. Today, we are the agency of record for most of our clients, many of whom have a national footprint. \n3: \n4: category: ABOUT THE AGENCY\noriginal_question: CAPABILITIES OVERVIEW\nresponses: We operate at the intersection of a consultancy and creative boutique. We believe getting to insights - a true understanding not just of the \"what's\" but the \"why's\" - is the genesis of all good ideas. Because of this, our core competencies are strategy, creative development, and media planning. All other capabilities including research, SEO\/SEM, social media, account and project management and analytics stem from those sources. We would partner with outside specialists (whom we are likely to have worked previously) se sources. We would partner with outside specialists (whom we are likely to have worked previously) to assist with Spanish language research, cultural understanding and copywriting. This is an approach we have employed successfully for Stripes Convenience Stores, Interstate Batteries and other clients. \n3: \n4: category: ABOUT THE AGENCY\noriginal_question: CAPABILITIES OVERVIEW\nresponses: We operate at the intersection of a consultancy and creative boutique. We believe getting to insights - a true understanding not just of the \"what's\" but the \"why's\" - is the genesis of all good ideas. Because of this, our core competencies are strategy, creative development, and media planning. All other capabilities including research, SEO\/SEM, social media, account and project management and analytics stem from those sources. We would partner with outside specialists (whom we are likely to have worked previously) se sources. We would partner with outside specialists (whom we are likely to have worked previously) to assist with Spanish language research, cultural understanding and copywriting. This is an approach we have employed successfully for Stripes Convenience Stores, Interstate Batteries and other clients. \n3: \n4: category: ABOUT THE AGENCY\noriginal_question: AGENCY DIFFERENTIATORS\n\nWHAT DO YOU HAVE, OR WHAT DO YOU DO, THAT YOUR COMPETITORS DONT?\nresponses: Our people. Our culture. And our clients.\nFirehouse has been built on the shoulders of a great team that works exceptionally well together. The credit for any success weve achieved belongs to them.\nOur culture makes Firehouse sticky. Its why we beat the industry averages for both employee and client retention. Its why people stay late to drink wine in the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is s the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is so strong.\nFinally, the relationships we have with our clients are built on trust and transparency. We still believe in the value of a handshake, keeping our word and, above all, continually asking ourselves, whats the right thing to do? not what is most expedient, politically savvy or lines our bank account. \nThe incredible results we get for our clients are never an accident. Theyre the product of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execu category: ABOUT THE AGENCY\noriginal_question: AGENCY DIFFERENTIATORS\n\nWHAT DO YOU HAVE, OR WHAT DO YOU DO, THAT YOUR COMPETITORS DONT?\nresponses: Our people. Our culture. And our clients.\nFirehouse has been built on the shoulders of a great team that works exceptionally well together. The credit for any success weve achieved belongs to them.\nOur culture makes Firehouse sticky. Its why we beat the industry averages for both employee and client retention. Its why people stay late to drink wine in the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is s the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is so strong.\nFinally, the relationships we have with our clients are built on trust and transparency. We still believe in the value of a handshake, keeping our word and, above all, continually asking ourselves, whats the right thing to do? not what is most expedient, politically savvy or lines our bank account. \nThe incredible results we get for our clients are never an accident. Theyre the product of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execu of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execution. \n3: Team Leadership\nAs your AOR, we see ourselves as the primary stewards of your brand and its adherence to a consistent brand strategy. We would guide your internal teams and other agency partners to common goals and shared expressions of the brand. \n\nAs AOR, we would also help to streamline communication, align marketing efforts based on an annual plan, and ensure consistency across all touchpoints. We would have regular, ongoing conversations with the other partners, keeping them infor the kitchen and clients schedule offsites at our place. Its also why our sense of shared values is so strong.\nFinally, the relationships we have with our clients are built on trust and transparency. We still believe in the value of a handshake, keeping our word and, above all, continually asking ourselves, whats the right thing to do? not what is most expedient, politically savvy or lines our bank account. \nThe incredible results we get for our clients are never an accident. Theyre the product of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execu of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execution. \n3: Team Leadership\nAs your AOR, we see ourselves as the primary stewards of your brand and its adherence to a consistent brand strategy. We would guide your internal teams and other agency partners to common goals and shared expressions of the brand. \n\nAs AOR, we would also help to streamline communication, align marketing efforts based on an annual plan, and ensure consistency across all touchpoints. We would have regular, ongoing conversations with the other partners, keeping them infor ouchpoints. We would have regular, ongoing conversations with the other partners, keeping them informed of plans or changes and linking arms to collaborate as needed. \n\nRight Size\nYour business would fit nicely in our portfolio of clients, being neither large enough to swamp the boat or small enough not to warrant our full attention. Weve always believed in scaling to meet client needs. Should your account require staff not currently in residence, we would grow to meet that demand. And, we stay close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe of purposeful intention, relentless passion, sincere effort, intelligent thinking and skillful execution. \n3: Team Leadership\nAs your AOR, we see ourselves as the primary stewards of your brand and its adherence to a consistent brand strategy. We would guide your internal teams and other agency partners to common goals and shared expressions of the brand. \n\nAs AOR, we would also help to streamline communication, align marketing efforts based on an annual plan, and ensure consistency across all touchpoints. We would have regular, ongoing conversations with the other partners, keeping them infor ouchpoints. We would have regular, ongoing conversations with the other partners, keeping them informed of plans or changes and linking arms to collaborate as needed. \n\nRight Size\nYour business would fit nicely in our portfolio of clients, being neither large enough to swamp the boat or small enough not to warrant our full attention. Weve always believed in scaling to meet client needs. Should your account require staff not currently in residence, we would grow to meet that demand. And, we stay close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe have all the capabilities you are seeking under one roof. And we believe that is more important today than ever. You cant afford for your marketing mix not to work in concert; message and medium need perfect orchestration. In fact, the work we were most awarded for this year all shared a common quality: an inseparable marriage of medium and message that achieved exponential effectiveness.\n\nAccountability\nAccountability is a big word for us. We believe we are only successful when our clients suc ouchpoints. We would have regular, ongoing conversations with the other partners, keeping them informed of plans or changes and linking arms to collaborate as needed. \n\nRight Size\nYour business would fit nicely in our portfolio of clients, being neither large enough to swamp the boat or small enough not to warrant our full attention. Weve always believed in scaling to meet client needs. Should your account require staff not currently in residence, we would grow to meet that demand. And, we stay close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe close to a stable of good talent that makes that scaling efficient and effective. \n\nCapabilities\nWe have all the capabilities you are seeking under one roof. And we believe that is more important today than ever. You cant afford for your marketing mix not to work in concert; message and medium need perfect orchestration. In fact, the work we were most awarded for this year all shared a common quality: an inseparable marriage of medium and message that achieved exponential effectiveness.\n\nAccountability\nAccountability is a big word for us. We believe we are only successful when our clients suc tability\nAccountability is a big word for us. We believe we are only successful when our clients succeed. We are diligent about campaign reporting, optimization and continual improvement to ensure we hit your KPIs. We also believe that part of being accountable is having and expressing a POV on the right thing to do for your brand. Not what is expedient, politically opportunistic or financially advantageous to the agency.\n\nPassion\nWe do our best work for brands we believe in. Lennox Residential would be an ideal client for us because its a brand with great products and consumer goodwill. Youre```\n", + "content": "test should not be last", "role": "assistant", "is_ai": false, "show": true,