Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

feat(llm): add integration for Claude #171

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sarthakkapila
Copy link

What does this PR do?

Added integration for Claude!

There's just one problem and that is i am not able to find model_card for claude in the docs as result i have commented that part.

Before submitting

  • [y] Was this discussed/approved in a Github issue or a discussion? Please add a link to it if that's the case.
  • [y] You have read the contribution guidelines and followed them in this PR.
  • [y] Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines.
  • [y] Did you write any new necessary tests?

@frgfm
Copy link
Member

frgfm commented May 30, 2024

For reference, this is a follow-up PR of #169

Copy link
Member

@frgfm frgfm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reworking the PR! There are still a few things to handle. For that to be easier for you, I suggest you locally install the anthropic library and check the model information and how it can be verified :)

Let me know if you have any questions!

# {datetime.fromtimestamp(model_card.created).isoformat()})",
)

def _validate_model(self) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it as a static method (with the corresponding arg, like in groq/openai integration)

self._validate_model()

self.temperature = temperature
# model_card = BaseModel.retrieve(model)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to verify whether the model selection is available

# model_card = BaseModel.retrieve(model)
logger.info(
f"Using Claude w/ {self.model} (created at "
# {datetime.fromtimestamp(model_card.created).isoformat()})",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the information is available, it would be worth displaying it :) I was only saying earlier that I'm not sure the attribute is named the same way than groq or openai


def _validate_model(self) -> None:
input_dict = {"model_type": self.model}
validation_result = BaseModel.model_validate(input_dict)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a confusion here: we want to validate the LLM name reference in the API (=model name), not the Pydantic schema model

@sarthakkapila
Copy link
Author

Ok noted 👍.
What other than model validation and model info might be the reasons for checks failing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants