UniLLM
1.0.0
UNILLM을 사용하면 100% 유형 안전성을 사용하여 OpenAI API를 사용하여 LLM을 호출 할 수 있습니다.
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
} ) ;더 많은 예제를보고 싶습니까? 대화식 문서 를 확인하십시오.
우리는 지역 사회의 기여를 환영합니다! 풀 요청을 제출하거나 버그 또는 기능 제안에 대한 문제를 만들어 주시기 바랍니다.
당신이 기여하고 싶지만 어떻게 확실하지 않다면, 우리의 불화에 가입하면 기꺼이 도와 드리겠습니다.
기고하기 전에 Contributing.md를 확인하십시오.
이 저장소의 소스 코드는 MIT에서 사용할 수 있습니다.