Assistant OpenAI

function

https://github.com/Mantonherre/OpenWebUI-Assistant-OpenAI.git Create your assistant in the OpenAI dashboard, generate an API key, and use this code to integrate it into Open WebUI. Ensure that these dependencies are installed in your Python environment before executing the script. pip install --upgrade openai. pip install pydantic, pip install typing-extensions

mantonherre
@mantonherre
·
2 years ago
372
0
1.2K
Updated 2 years ago
Created Jan 19, 2025
assistant_openai.py
Python · 102 lines
import openai
import os
import time
from typing import List, Union, Generator, Iterator
from pydantic import BaseModel, Field


class Pipe:
    class Valves(BaseModel):
        OPENAI_API_KEY: str = Field(default="")

    def __init__(self):

https://github.com/Mantonherre/OpenWebUI-Assistant-OpenAI.git Create your assistant in the OpenAI dashboard, generate an API key, and use this code to integrate it into Open WebUI. Ensure that these dependencies are installed in your Python environment before executing the script. pip install --upgrade openai. pip install pydantic, pip install typing-extensions


0