Skip to content

Conversation

AdvH039
Copy link
Contributor

@AdvH039 AdvH039 commented Oct 26, 2024

Refer #79

@AdvH039
Copy link
Contributor Author

AdvH039 commented Oct 27, 2024

@tarun-aiplanet please let me know you're happy with the implementation and if I can proceed the same with other llms. Thank you.

@tarun-aiplanet
Copy link
Contributor

Hi @AdvH039 Thanks for the PR. This is something similar we need. I will test it for Groq. Can you add for 2 more LLMs, so that we can test it at same time for 3 LLMs

model_name = self.config.model_name,
groq_api_key = self.config.groq_api_key,
temperature = self.config.temperature
self.llm = Groq(
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to keep this code within try-except. If API key is not detected, an exception needs to be triggered

@AdvH039
Copy link
Contributor Author

AdvH039 commented Oct 28, 2024

@tarun-aiplanet I added two more llms and used try-except. Please let me know if it's working. Thanks.

@@ -1,14 +1,11 @@
from typing import Any
from langchain_core.messages import HumanMessage
from groq import Groq
Copy link
Contributor

Choose a reason for hiding this comment

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

import groq under the exception block. or you can also import it under load function.

Refer: https://github.com/aiplanethub/beyondllm/blob/main/src/beyondllm/llms/chatgroq.py

return resp.content

try:
chat_completion = self.llm.chat.completions.create(
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually Langchain internally have Human messages which has the system prompt. Would you add an system prompt as well.

@tarun-aiplanet
Copy link
Contributor

@tarun-aiplanet I added two more llms and used try-except. Please let me know if it's working. Thanks.

cool. this looks good. the import statement and system prompt needs to fixed.

@AdvH039
Copy link
Contributor Author

AdvH039 commented Oct 28, 2024

@tarun-aiplanet Done. Thanks.

@tarun-aiplanet tarun-aiplanet added enhancement New feature or request hacktoberfest-accepted Hacktoberfest 2024 acccepted labels Oct 29, 2024
@shivaya-aiplanet
Copy link
Contributor

@AdvH039
Congrats on being approved for the Hacktoberfest swags! Please share your details with me so we can send it over to you.
You can either drop the details in our Discord channel: bit.ly/aiplanet-discord or email me at [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest-accepted Hacktoberfest 2024 acccepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants