add model feat table (#10921)

This commit is contained in:
Bagatur
2023-09-22 01:10:27 -07:00
committed by GitHub
parent ee8653f62c
commit dccc20b402
8 changed files with 278 additions and 30 deletions

View File

@@ -1,7 +1,6 @@
from typing import Any, AsyncIterator, Dict, Iterator, List, Optional
from typing import Any, Dict, Iterator, List, Optional
from langchain.callbacks.manager import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
)
from langchain.chat_models.anthropic import convert_messages_to_prompt_anthropic
@@ -59,17 +58,6 @@ class BedrockChat(BaseChatModel, BedrockBase):
delta = chunk.text
yield ChatGenerationChunk(message=AIMessageChunk(content=delta))
def _astream(
self,
messages: List[BaseMessage],
stop: Optional[List[str]] = None,
run_manager: Optional[AsyncCallbackManagerForLLMRun] = None,
**kwargs: Any,
) -> AsyncIterator[ChatGenerationChunk]:
raise NotImplementedError(
"""Bedrock doesn't support async requests at the moment."""
)
def _generate(
self,
messages: List[BaseMessage],
@@ -98,14 +86,3 @@ class BedrockChat(BaseChatModel, BedrockBase):
message = AIMessage(content=completion)
return ChatResult(generations=[ChatGeneration(message=message)])
async def _agenerate(
self,
messages: List[BaseMessage],
stop: Optional[List[str]] = None,
run_manager: Optional[AsyncCallbackManagerForLLMRun] = None,
**kwargs: Any,
) -> ChatResult:
raise NotImplementedError(
"""Bedrock doesn't support async stream requests at the moment."""
)

View File

@@ -30,8 +30,8 @@ def init_vertexai(
project: The default GCP project to use when making Vertex API calls.
location: The default location to use when making API calls.
credentials: The default custom
credentials to use when making API calls. If not provided credentials
will be ascertained from the environment.
credentials to use when making API calls. If not provided credentials
will be ascertained from the environment.
Raises:
ImportError: If importing vertexai SDK did not succeed.