Created
October 19, 2023 14:55
-
-
Save roh26it/c7b20efc1b8d62bf652f0867ccf7ae62 to your computer and use it in GitHub Desktop.
Anthropic / Portkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import portkey | |
from portkey import Config, LLMOptions | |
portkey.api_key = "<YOUR PORTKEY API KEY>" | |
llm = LLMOptions(provider="anthropic", virtual_key="<YOUR VIRTUAL KEY>") | |
portkey.config = Config(llms=[llm], mode="single") | |
response = portkey.ChatCompletions.create( | |
model="claude-instant-1.2", | |
messages=[{"role":"user", "content": "What is the meaning of life, universe & everything?"}], | |
max_tokens=400 | |
) | |
print(response.choices[0]["message"]["content"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment