Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llm: Add Anthropic support #377

Merged
merged 3 commits into from
Jul 2, 2024
Merged

llm: Add Anthropic support #377

merged 3 commits into from
Jul 2, 2024

Conversation

Panchajanya1999
Copy link
Contributor

The config goes like this:
{
"llm.api_type": "anthropic",
"llm.api_base": "https://api.anthropic.com/v1/messages",
"llm.api_key": "sk-ant-xxxxx",
"llm.model": "claude-3-opus"
}

(cherry picked from commit 0d95d3a3c831735d10865344dbfd8aa22173f214)
Signed-off-by: Panchajanya1999 [email protected]

The config goes like this:
{
	"llm.api_type": "anthropic",
        "llm.api_base": "https://api.anthropic.com/v1/messages",
        "llm.api_key": "sk-ant-xxxxx",
        "llm.model": "claude-3-opus"
}

(cherry picked from commit 0d95d3a3c831735d10865344dbfd8aa22173f214)
Signed-off-by: Panchajanya1999 <[email protected]>
@Panchajanya1999
Copy link
Contributor Author

@microsoft-github-policy-service agree

@Panchajanya1999
Copy link
Contributor Author

hi @liqul can you have a look into this? It works perfectly.

@liqul
Copy link
Contributor

liqul commented Jul 1, 2024

hi @liqul can you have a look into this? It works perfectly.

Thanks for your contribution. Could you add a markdown file here to explain how to configure it?

@liqul
Copy link
Contributor

liqul commented Jul 1, 2024

Could you address the test failure?

@Panchajanya1999
Copy link
Contributor Author

Panchajanya1999 commented Jul 1, 2024

Could you address the test failure?

Yeah, just added a commit to fix it. Still working on the md file.

@Panchajanya1999
Copy link
Contributor Author

Yeah, this is the doc.

Copy link
Contributor

@liqul liqul left a comment

Choose a reason for hiding this comment

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

It is not the way to fix the dependency issue. All LLMs must be optional, which means the user can choose not to install the libraries when they are using other LLM endpoints. Therefore, the way fixing the test issue is to move the import line into the init of the endpoint service class. You can take a look at other implementations for reference.

taskweaver/llm/anthropic.py Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
Signed-off-by: Panchajanya1999 <[email protected]>
(cherry picked from commit bd18ec9)
@Panchajanya1999
Copy link
Contributor Author

Hi @liqul can you check now?

@liqul liqul merged commit 5f61b04 into microsoft:main Jul 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants