Find answers from the community

Updated 2 months ago

I'm looking here, but I can't seem to

I'm looking here, but I can't seem to see where I would actually configure connections for things like Salesforce accounts that would be queried
L
L
5 comments
You'd have to setup the tools on the fly per user
@Logan M Would something like this work?

Plain Text
import os
from llama_index.agent.openai import OpenAIAgent
from fastapi import FastAPI, Body, HTTPException
from llama_index.tools.salesforce import SalesforceToolSpec
from llama_index.tools.slack import SlackToolSpec
from llama_index.tools.graphql import GraphQLToolSpec
from dotenv import load_dotenv

app = FastAPI()

sf = SalesforceToolSpec(
    username=Body.sf_username,
    password=Body.sf_password,
    consumer_key=Body.sf_consumer_key,
    consumer_secret=Body.sf_consumer_secret,
    domain="test",
)


agent = OpenAIAgent.from_tools(
    sf.to_tool_list(),
    llm=llm,
    verbose=True,
    system_prompt=system_prompt,
    memory=memory,
)


if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)
If so that's great because I can just use Body
Add a reply
Sign up and join the conversation on Discord