mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 23:59:45 +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) =>
|
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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user