Optimize the structure of the framework and mention, now both can be used simultaneously #114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several updates to the
QuoteAgent
and related components to enhance the handling of page context and improve the overall functionality of the application. The most important changes include adding new properties to theQuoteContext
class, updating methods to utilize these properties, and modifying theaskWithTool
method to better integrate page context.Enhancements to Quote Context:
src/agents/quote.ts
: AddedpageContent
andbrowserLanguage
properties to theQuoteContext
class. Updated methods to set these new properties. [1] [2]Updates to Template Handling:
src/assets/conf/tools.toml
: Modified templates to include newpageContent
property and updated the structure for better clarity. [1] [2]Changes to Chat Functionality:
src/chat/chat.ts
: Updated theaskWithTool
method to acceptpageContext
and integrate it into the prompt generation process. Simplified theaskWithQuotes
method to delegate toaskWithTool
. [1] [2] [3]Component Updates:
src/components/ask-panel.tsx
: IntroducedpageContext
state and updated theAskPanel
component to fetch and set the page context on initialization. Modified theonSend
function to passpageContext
to theaskWithTool
method. [1] [2] [3] [4] [5]Minor Fixes:
src/components/tool-preview.tsx
: Wrapped content in a<pre>
tag for better formatting.src/pages/content/ui/app.tsx
: Removed redundant call togetQuoteByDocument
whenquoteText
is not available.