mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-20 01:02:02 +00:00
fix: consolidate timeouts and IntelliJSearch tool safe execution
This commit is contained in:
parent
8552f4e634
commit
ff5a7784b7
2 changed files with 9 additions and 8 deletions
|
|
@ -32,10 +32,7 @@ import kotlin.io.encoding.ExperimentalEncodingApi
|
|||
public class CustomOpenAIClientSettings(
|
||||
baseUrl: String,
|
||||
chatCompletionsPath: String,
|
||||
timeoutConfig: ConnectionTimeoutConfig = ConnectionTimeoutConfig(
|
||||
requestTimeoutMillis = 120_000,
|
||||
socketTimeoutMillis = 120_000
|
||||
)
|
||||
timeoutConfig: ConnectionTimeoutConfig
|
||||
) : OpenAIBaseSettings(baseUrl, chatCompletionsPath, timeoutConfig)
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -127,10 +127,14 @@ class IntelliJSearchTool(
|
|||
|
||||
override suspend fun execute(args: Args): Result {
|
||||
try {
|
||||
val searchScope = createSearchScope(args, project)
|
||||
val effectiveLimit = (args.limit ?: 10).coerceAtLeast(1)
|
||||
val matches =
|
||||
withContext(Dispatchers.Default) { runReadAction { searchEverywhere(args.pattern, searchScope, effectiveLimit) } }
|
||||
val (searchScope, matches) = withContext(Dispatchers.Default) {
|
||||
runReadAction {
|
||||
val scope = createSearchScope(args, project)
|
||||
val effectiveLimit = (args.limit ?: 10).coerceAtLeast(1)
|
||||
val results = searchEverywhere(args.pattern, scope, effectiveLimit)
|
||||
scope to results
|
||||
}
|
||||
}
|
||||
val output = formatOutput(matches, args)
|
||||
|
||||
return Result(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue