Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
  • Loading branch information
slimsag committed Mar 26, 2024
1 parent 23fa968 commit c93b032
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions vscode/src/completions/providers/openaicompatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ import { CLOSING_CODE_TAG, getHeadAndTail, OPENING_CODE_TAG } from '../text-proc
import type { ContextSnippet } from '../types'
import { forkSignal, generatorWithTimeout, zipGenerators } from '../utils'

import type { AuthStatus } from '../../chat/protocol'
import type { FetchCompletionResult } from './fetch-and-process-completions'
import {
getCompletionParamsAndFetchImpl,
type AuthStatus,
} from '@sourcegraph/cody-shared'

Check failure on line 20 in vscode/src/completions/providers/openaicompatible.ts

View workflow job for this annotation

GitHub Actions / build

The type qualifier can be moved just after import to completely remove the import at compile time.

Check failure on line 20 in vscode/src/completions/providers/openaicompatible.ts

View workflow job for this annotation

GitHub Actions / build

All these imports are only used as types.

import { type FetchCompletionResult, fetchAndProcessDynamicMultilineCompletions } from './fetch-and-process-completions'
import {
MAX_RESPONSE_TOKENS,
getCompletionParams,
getLineNumberDependentCompletionParams,
} from './get-completion-params'
import {
Expand Down Expand Up @@ -86,8 +90,6 @@ function getMaxContextTokens(model: OpenAICompatibleModel): number {
}
}

const MAX_RESPONSE_TOKENS = 256

const lineNumberDependentCompletionParams = getLineNumberDependentCompletionParams({
singlelineStopSequences: ['\n'],
multilineStopSequences: ['\n\n', '\n\r\n'],
Expand Down Expand Up @@ -174,13 +176,11 @@ class OpenAICompatibleProvider extends Provider {
snippets: ContextSnippet[],
tracer?: CompletionProviderTracer
): AsyncGenerator<FetchCompletionResult[]> {
const { partialRequestParams, fetchAndProcessCompletionsImpl } = getCompletionParamsAndFetchImpl(
{
providerOptions: this.options,
timeouts: this.timeouts,
lineNumberDependentCompletionParams,
}
)
const partialRequestParams = getCompletionParams({
providerOptions: this.options,
timeouts: this.timeouts,
lineNumberDependentCompletionParams,
})

// starchat: Only use infill if the suffix is not empty
const useInfill = this.options.docContext.suffix.trim().length > 0
Expand Down Expand Up @@ -221,7 +221,7 @@ class OpenAICompatibleProvider extends Provider {
abortController
)

return fetchAndProcessCompletionsImpl({
return fetchAndProcessDynamicMultilineCompletions({
completionResponseGenerator,
abortController,
providerSpecificPostProcess: this.postProcess,
Expand Down

0 comments on commit c93b032

Please sign in to comment.