feat: enhance knowledge workflows and refresh interface

This commit is contained in:
lofyer
2026-08-10 16:27:40 +08:00
parent 2cb712e4ba
commit 0fab985f28
26 changed files with 4088 additions and 1183 deletions
+22 -1
View File
@@ -65,7 +65,12 @@ describe('createModelGraphExtractor', () => {
choices: [
{
message: {
content: '```json\n{"relations":[]}\n```'
content: [
{
type: 'text',
text: '```json\n{"relations":[]}\n```'
}
]
}
}
]
@@ -136,6 +141,22 @@ describe('createModelGraphExtractor', () => {
)
})
it('accepts top-level output text from compatible Responses providers', async () => {
const extract = createModelGraphExtractor(
store({ modelProtocol: 'openai-responses' }),
vi.fn(async () =>
jsonResponse({
output_text: '{"entities":[],"relations":[]}'
})
)
)
await expect(extract('extract this')).resolves.toEqual({
entities: [],
relations: []
})
})
it('requires a key only for API-key authentication', async () => {
const extract = createModelGraphExtractor(
store({