UniLLM
1.0.0
UNILLMを使用すると、OpenAI APIを使用してLLMを呼び出すことができ、100%のタイプの安全性があります。
Unillmを使用すると、ネイティブにサポートしていないプロバイダー/モデル(人類など)でもチャットの完了を使用できます。
npm i unillm import { UniLLM } from 'unillm' ;
const unillm = new UniLLM ( ) ;
// OpenAI
const response = await unillm . createChatCompletion ( "openai/gpt-3.5-turbo" , { messages : ... } ) ;
const response = await unillm . createChatCompletion ( "openai/gpt-4" , { messages : ... } ) ;
// Anthropic
const response = await unillm . createChatCompletion ( "anthropic/claude-2" , { messages : ... } ) ;
const response = await unillm . createChatCompletion ( "anthropic/claude-1-instant" , { messages : ... } ) ;
// Azure OpenAI
const response = await unillm . createChatCompletion ( "azure/openai/<deployment-name>" , { messages : ... } ) ;
// More coming soon!もっと例を見たいですか?インタラクティブドキュメントをご覧ください。
ストリーミングを有効にするには、 stream: trueオプションオブジェクトに提供するだけです。これが例です:
const response = await unillm . createChatCompletion ( "openai/gpt-3.5-turbo" , {
messages : ... ,
stream : true
} ) ;もっと例を見たいですか?インタラクティブドキュメントをご覧ください。
コミュニティからの貢献を歓迎します! Pullリクエストを送信したり、バグや機能の提案の問題を作成したりしてください。
貢献したいが、どのように貢献したいのなら、私たちの不一致に参加してください。喜んでお手伝いします!
寄付する前に、converting.mdをチェックしてください。
このリポジトリのソースコードは、MITで利用できます。