File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,4 +17,7 @@ COPY --from=builder /app/dist ./dist
1717
1818EXPOSE 4141
1919
20- CMD ["bun" , "run" , "dist/main.js" ]
20+ ARG GH_TOKEN
21+ ENV GH_TOKEN=$GH_TOKEN
22+
23+ CMD bun run dist/main.js start -g $GH_TOKEN --vision
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ import { countTokens } from "gpt-tokenizer/model/gpt-4o"
33import type { Message } from "~/services/copilot/create-chat-completions"
44
55export const getTokenCount = ( messages : Array < Message > ) => {
6- const input = messages . filter ( ( m ) => m . role !== "assistant" )
6+ const input = messages . filter (
7+ ( m ) => m . role !== "assistant" && typeof m . content === "string" ,
8+ )
9+ console . log ( input )
710 const output = messages . filter ( ( m ) => m . role === "assistant" )
811
912 const inputTokens = countTokens ( input )
You can’t perform that action at this time.
0 commit comments