feat: add TokenLab chat model#6605
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for TokenLab chat models by adding the TokenLabApi credential, defining TokenLab-hosted models in models.json, and implementing the ChatTokenLab chat model node. The feedback highlights two potential runtime issues: first, parsing an undefined or empty temperature value can result in NaN being passed to the model; second, parsing baseOptions as null could lead to a TypeError when checking for baseURL. Code suggestions are provided to safely handle these cases.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Thanks for the review. I pushed
Local validation: |
Description
Adds TokenLab as a first-class Chat Models option:
TokenLab APIcredentialChatTokenLabnode backed by@langchain/openaiwith TokenLab's OpenAI-compatible base URLhttps://api.tokenlab.sh/v1models.jsonbecause TokenLab pricing should not be inferred in this catalog without a dedicated pricing sourceTokenLab also exposes native endpoint families such as Responses, Anthropic Messages, and Gemini-compatible APIs, but this Flowise node intentionally uses the existing OpenAI-compatible chat model path.
Test
git diff --checkpython3 -m json.tool packages/components/models.jsonpnpm lint -- packages/components/nodes/chatmodels/ChatTokenLab/ChatTokenLab.ts packages/components/credentials/TokenLabApi.credential.ts, but this temporary checkout cannot run the project lint because the local environment has Node v22.22.2 and pnpm 9.15.0 while the repo requires Node ^24 and pnpm ^10.26.0.