Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Tools with Azure OpenAI #104

Closed
nazkhan-8451 opened this issue May 16, 2024 · 4 comments
Closed

How to use Tools with Azure OpenAI #104

nazkhan-8451 opened this issue May 16, 2024 · 4 comments

Comments

@nazkhan-8451
Copy link

If I want to use the following tool with Azure OpenAI, what would be config values? Please add detail example as it's not clear from the following code. I have GPT4 deployment in Azure named gpt4-128k and text embedding deployment named embedding-ada-002

tool = CSVSearchTool(
    config=dict(
        llm=dict(
            provider="ollama", # or google, openai, anthropic, llama2, ...
            config=dict(
                model="llama2",
                # temperature=0.5,
                # top_p=1,
                # stream=true,
            ),
        ),
        embedder=dict(
            provider="google", # or openai, ollama, ...
            config=dict(
                model="models/embedding-001",
                task_type="retrieval_document",
                # title="Embeddings",
            ),
        ),
    )
)
@lifexmetric
Copy link

The following worked for me.

csv_tool = CSVSearchTool(
    config=dict(
        llm=dict(
            provider="azure_openai", # or google, openai, anthropic, llama2, ...
            config=dict(
                model="gpt-4-32k",
                deployment_name="gpt-4-32k"
            ),
        ),
        embedder=dict(
            provider="azure_openai", # or openai, ollama, ...
            config=dict(
                model="text-embedding-3-large",
                deployment_name="text-embedding-3-large"
            ),
        ),
    ),
    csv='./process_conn_incr_1000.csv'
)

But assuming you have Azure OpenAI env var setup correctly as well as in the Azure Portal.

os.environ["AZURE_OPENAI_API_KEY"] = os.environ.get("AZURE_OPENAI_API_KEY")
os.environ["AZURE_OPENAI_ENDPOINT"] = os.environ.get("AZURE_OPENAI_ENDPOINT")
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-02-01"
os.environ["AZURE_OPENAI_CHAT_DEPLOYMENT_NAME"] = "gpt-4-32k"

@PiXOT97
Copy link

PiXOT97 commented Aug 29, 2024

The following worked for me.

csv_tool = CSVSearchTool(
    config=dict(
        llm=dict(
            provider="azure_openai", # or google, openai, anthropic, llama2, ...
            config=dict(
                model="gpt-4-32k",
                deployment_name="gpt-4-32k"
            ),
        ),
        embedder=dict(
            provider="azure_openai", # or openai, ollama, ...
            config=dict(
                model="text-embedding-3-large",
                deployment_name="text-embedding-3-large"
            ),
        ),
    ),
    csv='./process_conn_incr_1000.csv'
)

But assuming you have Azure OpenAI env var setup correctly as well as in the Azure Portal.

os.environ["AZURE_OPENAI_API_KEY"] = os.environ.get("AZURE_OPENAI_API_KEY")
os.environ["AZURE_OPENAI_ENDPOINT"] = os.environ.get("AZURE_OPENAI_ENDPOINT")
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-02-01"
os.environ["AZURE_OPENAI_CHAT_DEPLOYMENT_NAME"] = "gpt-4-32k"

Can you give more details on this setup?

Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Copy link

github-actions bot commented Oct 5, 2024

This issue was closed because it has been stale for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants