Add support for Anthropic models (#760)

* Add support for chatting with Anthropic's suite of models

- Had to use a custom class because there was enough nuance with how the anthropic SDK works that it would be better to simply separate out the logic. The extract questions flow needed modification of the system prompt in order to work as intended with the haiku model
This commit is contained in:
sabaimran
2024-05-26 22:50:34 +05:30
committed by GitHub
parent e2922968d6
commit 01cdc54ad0
10 changed files with 454 additions and 5 deletions

View File

@@ -84,6 +84,7 @@ class ChatModelOptions(BaseModel):
class ModelType(models.TextChoices):
OPENAI = "openai"
OFFLINE = "offline"
ANTHROPIC = "anthropic"
max_prompt_size = models.IntegerField(default=None, null=True, blank=True)
tokenizer = models.CharField(max_length=200, default=None, null=True, blank=True)