TogetherAI 통합

TogetherAI 통합

LangChain JavaScript로 TogetherAI LLM과 통합하는 방법을 알아봅니다.

Together AI50개 이상의 선도 오픈소스 모델을 몇 줄의 코드로 조회할 수 있는 API를 제공해요. LangChain으로 Together AI 텍스트 완성 모델(LLM)을 시작하는 데 도움을 주는 가이드입니다. TogetherAI 기능과 구성 옵션에 대한 자세한 문서는 API reference를 참조하세요.

출처: 문서

본문

현재 이 페이지는 Together AI 모델을 텍스트 완성 모델로 사용하는 방법을 다루는 문서예요. Together AI에서 제공하는 많은 인기 모델은 챗 완성 모델입니다.

아마 이 페이지를 찾고 계실 수도 있어요.

개요

통합 세부 정보

클래스(Class) 패키지(Package) 로컬(Local) 직렬화(Serializable) PY 지원 다운로드(Downloads) 버전(Version)
TogetherAI @langchain/together-ai NPM - Downloads NPM - Version

설정

레거시 TogetherAI 완성 클래스에 접근하려면 Together 계정을 만들고 API 키를 발급받은@langchain/together-ai 통합 패키지를 설치하세요. 채팅 및 인스트럭트 모델에는 ChatTogetherAI를 선호하세요.

자격 증명(Credentials)

api.together.ai에 방문해 Together AI에 가입하고 API 키를 생성하세요. TOGETHER_AI_API_KEY 환경 변수를 설정하세요:

export TOGETHER_AI_API_KEY="your-api-key"

모델 호출에 대한 자동 추적을 받으려면 아래 주석을 해제해 LangSmith API 키를 설정할 수도 있습니다:

# export LANGSMITH_TRACING="true"
# export LANGSMITH_API_KEY="your-api-key"

설치

LangChain TogetherAI 통합은 @langchain/together-ai 패키지에 있습니다:

npm install @langchain/together-ai @langchain/core
yarn add @langchain/together-ai @langchain/core
pnpm add @langchain/together-ai @langchain/core

인스턴스화(Instantiation)

완성 모델을 인스턴스화하세요:

import { TogetherAI } from "@langchain/together-ai";

const llm = new TogetherAI({
  model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
  maxTokens: 256,
});

호출(Invocation)

const inputText = "Together is an AI company that "

const completion = await llm.invoke(inputText)
completion
 offers a range of AI-powered solutions to help businesses and organizations improve their customer service, sales, and marketing efforts. Their platform uses natural language processing (NLP) and machine learning algorithms to analyze customer interactions and provide insights and recommendations to help businesses improve their customer experience.
Together's solutions include:
1. Customer Service: Together's customer service solution uses AI to analyze customer interactions and provide insights and recommendations to help businesses improve their customer experience. This includes analyzing customer feedback, sentiment analysis, and predictive analytics to identify areas for improvement.
2. Sales: Together's sales solution uses AI to analyze customer interactions and provide insights and recommendations to help businesses improve their sales efforts. This includes analyzing customer behavior, sentiment analysis, and predictive analytics to identify opportunities for upselling and cross-selling.
3. Marketing: Together's marketing solution uses AI to analyze customer interactions and provide insights and recommendations to help businesses improve their marketing efforts. This includes analyzing customer behavior, sentiment analysis, and predictive analytics to identify areas for improvement.
Together's platform is designed to be easy to use and integrates with a range of popular CRM and marketing automation tools. Their solutions are available as a cloud-based subscription service, making it easy for businesses to get started with AI-powered customer service, sales, and marketing.
Overall,

API reference

모든 TogetherAI 기능과 구성에 대한 자세한 문서는 API reference를 참조하세요.

더 알아보기 (Learn more)