Comments (1)
你是自己编写了翻译代码吗?
你可以参考以下代码
ChatGptTranslationServiceImpl.java 翻译开始的实现代码
com.xhxj.jsongpttranslator.translation.TranslationModeSwitcher 策略模式的实现
gpt-translator/src/main/java/com/xhxj/jsongpttranslator/translation/mode 你可以在这个包下新建你的翻译实现逻辑分别实现:
/**
* 批量翻译
* @param data
*/
void batchTranslate(List<TranslationData> data);
void translateOne(List<TranslationData> data);
/**
* 停止翻译
*/
void stopTranslate();
批量翻译的逻辑和单条翻译的逻辑,停止的可以不用写可以参考:
com.xhxj.jsongpttranslator.translation.mode.ChatTranslationMode 类
如果你想限制每分钟调用速率请在你请求发送的地方使用:
//限制每分钟的API调用
apiLimiter.waitForApiCallAvailability(0);
如果你想修改翻译速率修改:
ApiLimiter.java
private static int MAX_API_CALLS_PER_MINUTE = 3000; // 每分钟的API调用限制 (RPM)
private static int MAX_TOKENS_PER_MINUTE = 300000; // 每分钟的令牌限制 (TPM)
private static int MAX_REQUESTS_PER_SECOND = 2; // 每秒最大请求速率
from json-gpt-translator.
Related Issues (16)
- 是否可以添加4.0API接口的切换服务? HOT 2
- 我想问下可以修改启动的端口吗,8080的端口被占用了 HOT 1
- 为什么是上传excel文件之后带翻译条数总是0 HOT 7
- 运行测试时报错“系统异常” HOT 4
- 逐条翻译成本有点高了 HOT 1
- 系統異常 HOT 1
- 无法翻译 HOT 1
- 测试时出现了问题 HOT 2
- 系统异常 HOT 6
- 測試系統異常 HOT 1
- 严重串行,所有的短句都被合并到上下有关联的行里了。 HOT 10
- 项目里删除了但是 翻译查询里还有 HOT 4
- 系统异常 HOT 2
- 无法保存Chat GPT配置 HOT 4
- 一点测试就系统异常 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-gpt-translator.