mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Address roomote feedback and remove console log statement that were added for debugging
This commit is contained in:
parent
3867b84269
commit
ea2408fa26
3 changed files with 0 additions and 26 deletions
|
|
@ -168,7 +168,6 @@ export class WatsonxEmbedder implements IEmbedder {
|
|||
console.warn(`No embedding results for text at index ${textIndex}`)
|
||||
const expectedDimension = this.getExpectedDimension(modelToUse)
|
||||
if (expectedDimension > 0) {
|
||||
console.log(`Creating fallback embedding with dimension ${expectedDimension}`)
|
||||
const fallbackEmbedding = new Array(expectedDimension).fill(0.0001)
|
||||
return { index: textIndex, embedding: fallbackEmbedding, tokens: 0 }
|
||||
} else {
|
||||
|
|
@ -278,8 +277,6 @@ export class WatsonxEmbedder implements IEmbedder {
|
|||
*/
|
||||
async getAvailableModels(): Promise<Record<string, { dimension: number }>> {
|
||||
try {
|
||||
console.log("Fetching available IBM watsonx embedding models...")
|
||||
|
||||
const knownModels: Record<string, { dimension: number }> = {
|
||||
"ibm/slate-125m-english-rtrvr-v2": { dimension: 768 },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -339,7 +339,6 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
|
|||
}
|
||||
} else if (event.data.type === "embeddedWatsonxModels" && event.data.embeddedWatsonxModels) {
|
||||
try {
|
||||
console.log("Received IBM Embeded watsonx models:", event.data.embeddedWatsonxModels)
|
||||
let embeddedWatsonxModels: Record<string, { dimension: number }> = {}
|
||||
if (
|
||||
!event.data.embeddedWatsonxModels ||
|
||||
|
|
@ -352,7 +351,6 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
|
|||
}
|
||||
if (codebaseIndexModels) {
|
||||
codebaseIndexModels.watsonx = { ...embeddedWatsonxModels }
|
||||
console.log("Updated watsonx models in context:", codebaseIndexModels.watsonx)
|
||||
}
|
||||
setCurrentSettings((prev) => ({ ...prev }))
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -113,26 +113,19 @@ export const WatsonxAI = ({
|
|||
useEffect(() => {
|
||||
const handleMessage = (event: MessageEvent<ExtensionMessage>) => {
|
||||
const message = event.data
|
||||
console.log("Received message:", message.type, message)
|
||||
|
||||
if (message.type === "singleRouterModelFetchResponse" && !message.success) {
|
||||
const providerName = message.values?.provider as RouterName
|
||||
if (providerName === "watsonx") {
|
||||
console.log("Received error response for watsonx:", message.error)
|
||||
watsonxErrorJustReceived.current = true
|
||||
setRefreshStatus("error")
|
||||
setRefreshError(message.error)
|
||||
}
|
||||
} else if (message.type === "watsonxModels") {
|
||||
console.log("Received watsonxModels:", message.watsonxModels)
|
||||
setWatsonxModels(message.watsonxModels ?? {})
|
||||
if (refreshStatus === "loading") {
|
||||
if (!watsonxErrorJustReceived.current) {
|
||||
console.log("Setting refresh status to success")
|
||||
setRefreshStatus("success")
|
||||
} else {
|
||||
// Reset the flag after handling the error
|
||||
console.log("Resetting error flag")
|
||||
watsonxErrorJustReceived.current = false
|
||||
}
|
||||
}
|
||||
|
|
@ -154,7 +147,6 @@ export const WatsonxAI = ({
|
|||
)
|
||||
|
||||
const handleRefreshModels = useCallback(() => {
|
||||
console.log("Refresh models clicked")
|
||||
setRefreshStatus("loading")
|
||||
setRefreshError(undefined)
|
||||
watsonxErrorJustReceived.current = false
|
||||
|
|
@ -173,17 +165,6 @@ export const WatsonxAI = ({
|
|||
baseUrl = apiConfiguration.watsonxBaseUrl || ""
|
||||
}
|
||||
|
||||
console.log("Refresh models config:", {
|
||||
platform,
|
||||
baseUrl,
|
||||
hasApiKey: !!apiKey,
|
||||
hasUsername: !!username,
|
||||
authType,
|
||||
hasPassword: !!password,
|
||||
hasProjectId: !!projectId,
|
||||
selectedRegion,
|
||||
})
|
||||
|
||||
if (platform === "ibmCloud" && (!apiKey || !baseUrl)) {
|
||||
setRefreshStatus("error")
|
||||
setRefreshError(t("settings:providers.refreshModels.missingConfig"))
|
||||
|
|
@ -216,7 +197,6 @@ export const WatsonxAI = ({
|
|||
}
|
||||
}
|
||||
|
||||
console.log("Sending requestWatsonxModels message")
|
||||
vscode.postMessage({
|
||||
type: "requestWatsonxModels",
|
||||
values: {
|
||||
|
|
@ -389,7 +369,6 @@ export const WatsonxAI = ({
|
|||
<Button
|
||||
variant="outline"
|
||||
onClick={() => {
|
||||
console.log("Refresh button clicked")
|
||||
handleRefreshModels()
|
||||
}}
|
||||
disabled={
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue