Skip to content

Commit 7474351

Browse files
committed
feat: Add configuration and refactor token imports to lib directory
1 parent 46ed27a commit 7474351

5 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/lib/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const CONFIG = {
2+
EMULATE_STREAMING: false,
3+
LOGGING_ENABLED: false,
4+
}

src/lib/initialization.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { getGitHubUser } from "~/services/github/get-user/service"
88

99
import type { parseCli } from "./cli"
1010

11-
import { TOKENS } from "../config/tokens"
1211
import { getModels } from "../services/copilot/get-models/service"
1312
import { getCopilotToken } from "../services/copilot/get-token/copilot-token"
1413
import { getGitHubToken } from "../services/github/get-token/service"
1514
import { CACHE } from "./cache"
1615
import { initializeLogger } from "./logger"
16+
import { TOKENS } from "./tokens"
1717

1818
interface InitStep {
1919
name: string
File renamed without changes.

src/services/api-instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import consola from "consola"
22
import { FetchError, ofetch } from "ofetch"
33

44
import { COPILOT_CONFIG, GITHUB_CONFIG, GITHUB_WEB_CONFIG } from "~/config/api"
5-
import { TOKENS } from "~/config/tokens"
5+
import { TOKENS } from "~/lib/tokens"
66

77
export const copilot = ofetch.create({
88
baseURL: COPILOT_CONFIG.baseURL,

src/services/copilot/chat-completions/service-streaming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { stream } from "fetch-event-stream"
33
import type { ChatCompletionsPayload } from "./types"
44

55
import { COPILOT_CONFIG } from "../../../config/api"
6-
import { TOKENS } from "../../../config/tokens"
6+
import { TOKENS } from "../../../lib/tokens"
77

88
export const chatCompletionsStream = async (payload: ChatCompletionsPayload) =>
99
stream(`${COPILOT_CONFIG.baseURL}/chat/completions`, {

0 commit comments

Comments
 (0)