Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitAuto: llama访问失败 #150

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Fānyì (翻译)

A 🇨🇳 and 🇺🇸🇬🇧 translator in your command line, powered by iciba and groq.
Ensure that the GROQ_API_KEY is set in your environment variables.

[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]
Expand Down
2 changes: 2 additions & 0 deletions bin/fanyi.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env -S node --no-deprecation
import process from 'process';

import { readFile } from 'node:fs/promises';
GROQ_API_KEY = process.env.GROQ_API_KEY,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Declare the GROQ_API_KEY variable using const to prevent accidental reassignment and to follow best practices for variable declaration. [best practice]

Suggested change
GROQ_API_KEY = process.env.GROQ_API_KEY,
const GROQ_API_KEY = process.env.GROQ_API_KEY;

import chalk from 'chalk';
import { Command } from 'commander';
import updateNotifier from 'update-notifier';
Expand Down
2 changes: 2 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { XMLParser } from 'fast-xml-parser';
import process from 'process';
import gradient from 'gradient-string';
import { Groq } from 'groq-sdk';
GROQ_API_KEY = process.env.GROQ_API_KEY,
import fetch from 'node-fetch';
import ora from 'ora';
import { printIciba } from './lib/iciba.mjs';
Expand Down
1 change: 1 addition & 0 deletions tests/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
Ensure that the GROQ_API_KEY is set in your environment variables.

exports[`fanyi CLI > should print help if -h is given 1`] = `
"Usage: fanyi [options] [command]
Expand Down
Loading