Skip to content

How to implement bind_tools for a custom AlephAlpha chat model #24435

Answered by usersina
usersina asked this question in Q&A
Discussion options

You must be logged in to vote

The last one was a good suggestion, here's the big picture for prosperity:

import json
import uuid
from typing import (
    Any,
    Callable,
    Dict,
    List,
    Literal,
    Optional,
    Sequence,
    Type,
    Union,
    cast,
)

from aleph_alpha_client import CompletionRequest, Prompt
from langchain_community.llms.utils import enforce_stop_tokens
from langchain_core.callbacks import (
    CallbackManagerForLLMRun,
)
from langchain_core.language_models.base import LanguageModelInput
from langchain_core.language_models.chat_models import (
    BaseChatModel,
)
from langchain_core.messages import (
    AIMessage,
    BaseMessage,
    ChatMessage,
    HumanMessage,
    SystemMessage,…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@dosubot
Comment options

@usersina
Comment options

@dosubot
Comment options

@usersina
Comment options

Answer selected by usersina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant