Skip to content

Commit

Permalink
slight refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hitesh-1997 committed Mar 5, 2025
1 parent 9551acd commit 8f33ffb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import {
modelsService,
ps,
} from '@sourcegraph/cody-shared'
import type { EditIntent } from '../../types'
import type { BuildInteractionOptions, BuiltInteraction, EditPromptBuilder } from '../type'
import type { EditIntent } from '../types'
import type { BuildInteractionOptions, BuiltInteraction, EditPromptBuilder } from './type'

import { PromptBuilder } from '../../../prompt-builder'
import { getContext } from '../context'
import { claude } from '../models/claude'
import { openai } from '../models/openai'
import type { EditLLMInteraction, GetLLMInteractionOptions, LLMInteraction } from '../type'
import { PromptBuilder } from '../../prompt-builder'
import { getContext } from './context'
import { claude } from './models/claude'
import { openai } from './models/openai'
import type { EditLLMInteraction, GetLLMInteractionOptions, LLMInteraction } from './type'

const INTERACTION_PROVIDERS: Record<EditProvider, EditLLMInteraction> = {
Anthropic: claude,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type PromptString, ps } from '@sourcegraph/cody-shared'
import dedent from 'dedent'
import { describe, expect, it } from 'vitest'
import * as vscode from 'vscode'
import { document } from '../../../completions/test-helpers'
import { document } from '../../../../completions/test-helpers'
import {
getCurrentTokenCount,
getInstructionPromptWithCharLimit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ import {
import {
getPrefixWithCharLimit,
getSuffixWithCharLimit,
} from '../../../completions/get-current-doc-context'
import { lines } from '../../../completions/text-processing'
import { SMART_APPLY_CUSTOM_PROMPT_TOPICS } from '../constants'
import type { BuildInteractionOptions, BuiltInteraction, EditPromptBuilder } from '../type'
} from '../../../../completions/get-current-doc-context'
import { lines } from '../../../../completions/text-processing'
import { SMART_APPLY_CUSTOM_PROMPT_TOPICS } from '../../../../edit/prompt/constants'
import type {
BuildInteractionOptions,
BuiltInteraction,
EditPromptBuilder,
} from '../../../../edit/prompt/type'

// https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct
const CUSTOM_MODEL_DEFAULTS = {
Expand Down
4 changes: 2 additions & 2 deletions vscode/src/edit/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import { DefaultModelParameterProvider } from './adapters/default'
import { SmartApplyCustomModelParameterProvider } from './adapters/smart-apply-custom'
import type { EditManagerOptions } from './edit-manager'
import { responseTransformer } from './output/response-transformer'
import { DefaultEditPromptBuilder } from './prompt/builder/default'
import { SmartApplyCustomEditPromptBuilder } from './prompt/builder/smart-apply-custom'
import { DefaultEditPromptBuilder } from './prompt'
import { PROMPT_TOPICS, SMART_APPLY_MODEL_IDENTIFIERS } from './prompt/constants'
import { SmartApplyCustomEditPromptBuilder } from './prompt/smart-apply/apply/smart-apply-custom'
import type { EditPromptBuilder } from './prompt/type'
import { EditIntentTelemetryMetadataMapping, EditModeTelemetryMetadataMapping } from './types'
import { isStreamedIntent } from './utils/edit-intent'
Expand Down

0 comments on commit 8f33ffb

Please sign in to comment.