-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adapte to non-streaming mode LLM (#110)
- Loading branch information
Showing
6 changed files
with
201 additions
and
86 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export class SortedSet<Key extends string | number | symbol, Element> { | ||
private keySet = new Set<Key>(); | ||
private elements: Element[] = []; | ||
|
||
has(key: Key) { | ||
return this.keySet.has(key); | ||
} | ||
|
||
add(key: Key, element: Element) { | ||
if (!this.keySet.has(key)) { | ||
this.keySet.add(key); | ||
this.elements.push(element); | ||
} | ||
} | ||
|
||
asList(): Element[] { | ||
return this.elements; | ||
} | ||
} |
Oops, something went wrong.