
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
google-llm-bridge
Advanced tools
Google Generative AI(Gemini)와 llm-bridge-spec
공통 인터페이스를 연결하는 어댑터입니다. 모델, 가격, 컨텍스트 정보와 생성 옵션을 한곳에서 관리하여 새 모델이 추가되더라도 최소한의 수정으로 확장할 수 있습니다.
GoogleModelEnum
과 Zod 스키마로 모델과 옵션을 검증하고 기본값을 제공합니다.toolCalls
로 변환하고, 스트림 모드에서도 증분 텍스트와 사용량을 순차적으로 제공합니다.pnpm add google-llm-bridge llm-bridge-spec @google/generative-ai zod
import { createGoogleAIBridge, GoogleModelEnum } from 'google-llm-bridge';
const bridge = createGoogleAIBridge({
apiKey: process.env.GOOGLE_API_KEY!,
model: GoogleModelEnum.GEMINI_1_5_FLASH,
temperature: 0.4,
maxOutputTokens: 2048,
safetySettings: [{ category: 'HARM_CATEGORY_HATE_SPEECH', threshold: 'BLOCK_LOW_AND_ABOVE' }],
});
const response = await bridge.invoke({
messages: [
{ role: 'system', content: [{ contentType: 'text', value: 'You are a concise assistant.' }] },
{ role: 'user', content: [{ contentType: 'text', value: '서울 날씨를 알려줘.' }] },
],
tools: [
{
name: 'getWeather',
description: 'Retrieve the weather forecast',
parameters: {
type: 'object',
properties: { city: { type: 'string' } },
required: ['city'],
},
},
],
});
console.log(response.content.value);
if (response.toolCalls?.length) {
console.log('tool call arguments:', response.toolCalls[0].arguments);
}
const stream = bridge.invokeStream({
messages: [
{ role: 'user', content: [{ contentType: 'text', value: '10줄 이내로 자기소개해줘' }] },
],
});
for await (const chunk of stream) {
if (chunk.content.value) {
process.stdout.write(chunk.content.value);
}
}
옵션 | 설명 |
---|---|
model | GoogleModelEnum 중 하나 (기본값 gemini-1.5-flash ) |
temperature , topP , topK | 샘플링 파라미터 |
maxOutputTokens , stopSequences , candidateCount | 출력 제어 옵션 |
responseMimeType , responseSchema | JSON 출력 강제·스키마 정의 |
presencePenalty , frequencyPenalty | 반복 억제 계수 |
safetySettings | Safety 필터 기준(카테고리/임계값) |
지원되는 모델과 최신 스펙은 docs/models.md에서 확인할 수 있습니다. 문서에 정리된 정보는 google-models.ts
의 MODEL_METADATA
를 기반으로 자동으로 유지됩니다.
FAQs
Google Gemini LLM Bridge
We found that google-llm-bridge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.