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:
icarus 2025-09-19 23:50:04 +08:00
parent c7ec55c69a
commit f35987a9a9

View File

@ -82,7 +82,7 @@ export class AgentApiClient {
public getSessionMessagesPath = (agentId: string, sessionId: string) => public getSessionMessagesPath = (agentId: string, sessionId: string) =>
`/${this.apiVersion}/agents/${agentId}/sessions/${sessionId}/messages` `/${this.apiVersion}/agents/${agentId}/sessions/${sessionId}/messages`
public modelsPath = (props?: ApiModelsFilter) => { public getModelsPath = (props?: ApiModelsFilter) => {
const base = `/${this.apiVersion}/models` const base = `/${this.apiVersion}/models`
if (!props) return base if (!props) return base
if (objectKeys(props).length > 0) { if (objectKeys(props).length > 0) {
@ -236,7 +236,7 @@ export class AgentApiClient {
} }
public async getModels(props?: ApiModelsFilter): Promise<ApiModelsResponse> { public async getModels(props?: ApiModelsFilter): Promise<ApiModelsResponse> {
const url = this.modelsPath(props) const url = this.getModelsPath(props)
try { try {
const response = await this.axios.get(url) const response = await this.axios.get(url)
const data = ApiModelsResponseSchema.parse(response.data) const data = ApiModelsResponseSchema.parse(response.data)