feat(ai): add deep reading model and controller method
- Introduced `AIDeepReadingModel` to define the structure for deep reading responses. - Added `getDeepReading` method in `AIController` to fetch deep reading data for a given article ID. - Updated imports in `ai.ts` to include the new deep reading model. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import type { IRequestAdapter } from '~/interfaces/adapter'
|
|||||||
import type { IController } from '~/interfaces/controller'
|
import type { IController } from '~/interfaces/controller'
|
||||||
import type { IRequestHandler } from '~/interfaces/request'
|
import type { IRequestHandler } from '~/interfaces/request'
|
||||||
import type { HTTPClient } from '../core'
|
import type { HTTPClient } from '../core'
|
||||||
import type { AISummaryModel } from '../models/ai'
|
import type { AIDeepReadingModel, AISummaryModel } from '../models/ai'
|
||||||
|
|
||||||
import { autoBind } from '~/utils/auto-bind'
|
import { autoBind } from '~/utils/auto-bind'
|
||||||
|
|
||||||
@@ -58,4 +58,14 @@ export class AIController<ResponseWrapper> implements IController {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Core >= 8.3.0
|
||||||
|
* @param articleId
|
||||||
|
*/
|
||||||
|
async getDeepReading(articleId: string) {
|
||||||
|
return this.proxy('deep-readings')
|
||||||
|
.article(articleId)
|
||||||
|
.get<AIDeepReadingModel>()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,3 +6,12 @@ export interface AISummaryModel {
|
|||||||
refId: string
|
refId: string
|
||||||
lang: string
|
lang: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface AIDeepReadingModel {
|
||||||
|
id: string
|
||||||
|
hash: string
|
||||||
|
refId: string
|
||||||
|
keyPoints: string[]
|
||||||
|
criticalAnalysis: string
|
||||||
|
content: string
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user