feat: enhance knowledge workflows and refresh interface
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user