User_id creation for client and formatting (#2264)

This commit is contained in:
Dev Khant
2025-02-28 00:00:11 +05:30
committed by GitHub
parent ff4510f83d
commit ecff6315e7
4 changed files with 9 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ class LlmConfig(BaseModel):
"azure_openai_structured",
"gemini",
"deepseek",
"xai"
"xai",
):
return v
else:

View File

@@ -18,11 +18,7 @@ class XAILLM(LLMBase):
base_url = self.config.xai_base_url or os.getenv("XAI_API_BASE") or "https://api.x.ai/v1"
self.client = OpenAI(api_key=api_key, base_url=base_url)
def generate_response(
self,
messages: List[Dict[str, str]],
response_format=None
):
def generate_response(self, messages: List[Dict[str, str]], response_format=None):
"""
Generate a response based on the given messages using XAI.