-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Include pinned files in the content considered by vector terms
Fixes #2199
- Loading branch information
1 parent
ab1b0b6
commit 355d931
Showing
20 changed files
with
288 additions
and
111 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
File content fetcher is used to detect the locations of files that are mentioned in the chat, and to | ||
fetch the content of those files. | ||
|
||
### Sequence Diagram | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant GenerateAgent as GenerateAgent | ||
participant TestAgent as TestAgent | ||
participant ClientRequest as ClientRequest | ||
participant ChatHistory as ChatHistory | ||
participant FileContentFetcher as FileContentFetcher | ||
participant FileChangeExtractorService as FileChangeExtractorService | ||
participant ContextService as ContextService | ||
alt Invocation by GenerateAgent | ||
GenerateAgent->>FileContentFetcher: applyFileContext(options, options.chatHistory) | ||
end | ||
alt Invocation by TestAgent | ||
TestAgent->>FileContentFetcher: applyFileContext(options, options.chatHistory) | ||
end | ||
activate FileContentFetcher | ||
FileContentFetcher->>FileChangeExtractorService: listFiles(clientRequest, chatHistory) | ||
activate FileChangeExtractorService | ||
FileChangeExtractorService-->>FileContentFetcher: fileNames | ||
deactivate FileChangeExtractorService | ||
alt FileNames Found | ||
FileContentFetcher->>ContextService: locationContext(fileNames) | ||
activate ContextService | ||
ContextService-->>FileContentFetcher: Context updated | ||
deactivate ContextService | ||
else No FileNames | ||
FileContentFetcher-->>ClientRequest: return undefined | ||
end | ||
deactivate FileContentFetcher | ||
``` | ||
|
||
### Class Map | ||
|
||
```mermaid | ||
classDiagram | ||
class FileContentFetcher { | ||
+applyFileContext(clientRequest: ClientRequest, chatHistory: ChatHistory | undefined): void | ||
} | ||
class FileChangeExtractorService { | ||
+listFiles(clientRequest: ClientRequest, chatHistory: ChatHistory | undefined): string[] | ||
} | ||
class ContextService { | ||
+locationContext(fileNames: string[]): void | ||
} | ||
class GenerateAgent { | ||
+applyFileContext(options: AgentOptions, chatHistory: ChatHistory | undefined): void | ||
} | ||
class TestAgent { | ||
+applyFileContext(options: AgentOptions, chatHistory: ChatHistory | undefined): void | ||
} | ||
GenerateAgent --> FileContentFetcher : use | ||
TestAgent --> FileContentFetcher : use | ||
FileContentFetcher --> FileChangeExtractorService : relies on | ||
FileContentFetcher --> ContextService : interacts with | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.