Spaces:
Sleeping
Sleeping
Commit
·
d1bb0ce
1
Parent(s):
10231de
LLm groq integration
Browse files- src/LLMS/groqllm.py +20 -0
src/LLMS/groqllm.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import autogen
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
import streamlit as st
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class GroqLLM:
|
| 8 |
+
def __init__(self, user_controls_input):
|
| 9 |
+
self.user_controls_input = user_controls_input
|
| 10 |
+
|
| 11 |
+
def groq_llm_config(self):
|
| 12 |
+
config_list = [
|
| 13 |
+
{"api_type": 'groq',
|
| 14 |
+
"model": self.user_controls_input['selected_groq_model'], "api_key": st.session_state["GROQ_API_KEY"],
|
| 15 |
+
"cache_seed": None}
|
| 16 |
+
]
|
| 17 |
+
|
| 18 |
+
llm_config = {"config_list": config_list}
|
| 19 |
+
st.session_state['llm_config'] = llm_config
|
| 20 |
+
return llm_config
|