-
Notifications
You must be signed in to change notification settings - Fork 397
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
Add input params for OpenAI, Anthropic, Together AI LLMs #484
Conversation
src/pipecat/services/anthropic.py
Outdated
@@ -82,12 +87,16 @@ def __init__( | |||
model: str = "claude-3-5-sonnet-20240620", | |||
max_tokens: int = 4096, | |||
enable_prompt_caching_beta: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should add max_tokens
and enable_prompt_caching_beta
to InputParams
as well. It's a breaking change, but we are breaking a few things in this next release, so it should be fine. In the emotion Cartesia PR we are also breaking it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I held off because this was breaking, but I'll make the change now.
|
||
def __init__( | ||
self, | ||
*, | ||
api_key: str, | ||
model: str = "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo", | ||
max_tokens: int = 4096, | ||
params: InputParams = InputParams(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably add max_tokens
inside InputParams
here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Looks great! Just a couple of comments. |
fde2bbb
to
99eb2cd
Compare
src/pipecat/services/together.py
Outdated
self._temperature = temperature | ||
|
||
async def set_top_k(self, top_k: float): | ||
logger.debug(f"Switching LLM top_p to: [{top_k}]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching LLM top_k
*, | ||
model: str = "gpt-4o", | ||
params: BaseOpenAILLMService.InputParams = BaseOpenAILLMService.InputParams(), | ||
**kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
99eb2cd
to
f3fd312
Compare
I've opted to keep the inputs to the most common options. With this structure in place, it'll be easy to expand as needed.
Also, I added a Together AI example to make testing with Together AI easier.