Skip to content

Commit

Permalink
disable log
Browse files Browse the repository at this point in the history
  • Loading branch information
pyama committed Aug 27, 2024
1 parent 3360955 commit ff117e7
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ async function getNumberOfTokens (messages: ChatCompletionUserMessageParam[]): P
for (const message of messages) {
if (message.role === 'user') {
for (const content of message.content as any[]) {
console.log(content.text)
if (content.type === 'text') {
length += encoding.encode(content.text).length
} else if (content.type === 'image_url') {
Expand All @@ -44,15 +43,12 @@ export async function ask (messages: ChatCompletionUserMessageParam[], model: st

console.log(model)
console.log('numberOfTokens', numberOfTokens)
console.dir(messages, { depth: null })

const response = await openai.chat.completions.create({
model,
messages,
max_tokens
})
console.dir(response)
console.dir(response, { depth: null })

return response.choices[0].message?.content
}
Expand Down

0 comments on commit ff117e7

Please sign in to comment.