feat: add togheterai

This commit is contained in:
Marco Vinciguerra 2024-08-28 17:02:48 +02:00
parent dbec55064f
commit 8f615adef3
4 changed files with 11 additions and 3 deletions

View File

@ -36,7 +36,7 @@ By the way if you to use not mandatory modules it is necessary to install by you
### Installing "Other Language Models"
This group allows you to use additional language models like Fireworks, Groq, Anthropic, Hugging Face, and Nvidia AI Endpoints.
This group allows you to use additional language models like Fireworks, Groq, Anthropic, togheterai, Hugging Face, and Nvidia AI Endpoints.
```bash
pip install scrapegraphai[other-language-models]

View File

@ -77,6 +77,7 @@ other-language-models = [
"langchain-anthropic>=0.1.11",
"langchain-huggingface>=0.0.3",
"langchain-nvidia-ai-endpoints>=0.1.6",
"together==1.2.9"
]
# Group 2: More Semantic Options

View File

@ -157,10 +157,14 @@ class AbstractGraph(ABC):
from langchain_community.chat_models import ErnieBotChat
return ErnieBotChat(**llm_params)
if llm_params["model_provider"] == "oneapi":
elif llm_params["model_provider"] == "oneapi":
return OneApi(**llm_params)
if llm_params["model_provider"] == "nvidia":
elif llm_params["model_provider"] == "togehterai":
from langhcain_together import ChatTogether
return ChatTogether(**llm_params)
elif llm_params["model_provider"] == "nvidia":
try:
from langchain_nvidia_ai_endpoints import ChatNVIDIA
except ImportError:

View File

@ -127,6 +127,9 @@ models_tokens = {
"gemma-7b-it": 8192,
"claude-3-haiku-20240307'": 8192,
},
"togheterai": {
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": 128000
},
"anthropic": {
"claude_instant": 100000,
"claude2": 9000,