Add custom assistant context aggregator for Grok due to content requirement in function calling

This commit is contained in:
Mark Backman
2024-12-17 09:11:21 -05:00
parent fe0a7d07bd
commit ca086a856f
3 changed files with 107 additions and 7 deletions

View File

@@ -65,7 +65,7 @@ async def main():
)
llm = NimLLMService(
api_key=os.getenv("NVIDIA_API_KEY"), model="meta/llama-3.1-405b-instruct"
api_key=os.getenv("NVIDIA_API_KEY"), model="meta/llama-3.3-70b-instruct"
)
# Register a function_name of None to get all functions
# sent to the same callback with an additional function_name parameter.
@@ -76,18 +76,18 @@ async def main():
type="function",
function={
"name": "get_current_weather",
"description": "Get the current weather",
"description": "Returns the current weather at a location, if one is specified, and defaults to the user's location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
"description": "The location to find the weather of, or if not provided, it's the default location.",
},
"format": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "The temperature unit to use. Infer this from the users location.",
"description": "Whether to use SI or USCS units (celsius or fahrenheit).",
},
},
"required": ["location", "format"],