mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-29 05:51:26 +08:00
refactor(api): rename modelsPath to getModelsPath for consistency
Align method naming with other path getter methods in the class for better code maintainability and consistency
This commit is contained in:
parent
c7ec55c69a
commit
f35987a9a9
@ -82,7 +82,7 @@ export class AgentApiClient {
|
||||
public getSessionMessagesPath = (agentId: string, sessionId: string) =>
|
||||
`/${this.apiVersion}/agents/${agentId}/sessions/${sessionId}/messages`
|
||||
|
||||
public modelsPath = (props?: ApiModelsFilter) => {
|
||||
public getModelsPath = (props?: ApiModelsFilter) => {
|
||||
const base = `/${this.apiVersion}/models`
|
||||
if (!props) return base
|
||||
if (objectKeys(props).length > 0) {
|
||||
@ -236,7 +236,7 @@ export class AgentApiClient {
|
||||
}
|
||||
|
||||
public async getModels(props?: ApiModelsFilter): Promise<ApiModelsResponse> {
|
||||
const url = this.modelsPath(props)
|
||||
const url = this.getModelsPath(props)
|
||||
try {
|
||||
const response = await this.axios.get(url)
|
||||
const data = ApiModelsResponseSchema.parse(response.data)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user