This is the Grok API function to hook into my workflow.
This is the code to hook my workflow into Hugging Face API for text completions.
These two example show just how easy it is to connect an entire cloud API into my workflow system and then be able to use those API's to do text completions for a workflow. :D
There is the agent definitions to connect the agent to the function. Eventually the code will be stored directly inside the agent definition in the config file. I am doing it this way because there will eventually be hundreds of api connections and I want people to use simple bullet proof functions to connect to all those APIs, both local and remote.
"groq_text_completion": {
"type": "proc",
"help": "make a groq chat text completion",
"function": "groq_text_completion",
"function_def": "",
"inputs": [
"groq_request",
"groq_model",
"groq_api_key"
],
"optional_inputs": [],
"outputs": [
"response"
]
},
"get_groq_response": {
"type": "workflow",
"help": "Given a prompt, get the ollama response.",
"inputs": [
"prompt"
],
"optional_inputs": [],
"outputs": [
"response"
],
"return_on_fail": 1,
"steps": [
{
"agent": "groq_text_completion",
"params": {
"groq_request": "$prompt",
"groq_model": "llama3-8b-8192",
"groq_api_key": "Your api key"
},
"output": [
"response"
]
}
]
},
"hugging_text_completion": {
"type": "proc",
"help": "make a hugging chat text completion.",
"function": "hugging_text_completion",
"function_def": "",
"inputs": [
"hugging_request",
"hugging_model",
"hugging_user_name",
"hugging_password"
],
"optional_inputs": [],
"outputs": [
"response"
]
},
"get_hugging_response": {
"type": "workflow",
"help": "Given a prompt, get the response.",
"inputs": [
"prompt"
],
"optional_inputs": [],
"outputs": [
"response"
],
"return_on_fail": 1,
"steps": [
{
"agent": "hugging_text_completion",
"params": {
"hugging_request": "$prompt",
"hugging_model": 1,
"hugging_user_name": "your email",
"hugging_password": "your password"
},
"output": [
"response"
]
}
]
},
No comments:
Post a Comment