Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/api/providers/pearai/pearai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl

if (modelId.startsWith("pearai")) {
try {
// TODO: For some reason, if we move this fetch to above this if statement, it breaks everything)
const response = await fetch(`${PEARAI_URL}/getPearAIAgentModels`)
if (!response.ok) {
throw new Error(`Failed to fetch models: ${response.statusText}`)
Expand Down Expand Up @@ -117,6 +118,7 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
}

getModel(): { id: string; info: ModelInfo } {
// TODO: this.pearAiModelsResponse is always undefined so we curretly have to just use client side model info
if (this.options.apiModelId) {
let modelInfo = null
if (this.options.apiModelId.startsWith("pearai")) {
Expand Down
2 changes: 2 additions & 0 deletions src/api/providers/pearai/pearaiGeneric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class PearAIGenericHandler extends BaseProvider implements SingleCompleti
constructor(options: OpenAiHandlerOptions) {
super()
this.options = options
console.dir("Model ID")
console.dir(this.options.openAiModelId)

const baseURL = this.options.openAiBaseUrl ?? "https://api.openai.com/v1"
const apiKey = this.options.openAiApiKey ?? "not-provided"
Expand Down
Loading