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

[FEATURE] Azure open AI support #179

Open
sashankh opened this issue Mar 13, 2024 · 2 comments
Open

[FEATURE] Azure open AI support #179

sashankh opened this issue Mar 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@sashankh
Copy link

Is your feature request related to a problem? Please describe.

Does this work with Azure Open AI today? We can add that support.

Describe the solution you'd like

Works with Azure Open AI

Describe alternatives you've considered

Additional context

@sashankh sashankh added the enhancement New feature or request label Mar 13, 2024
@faddy19
Copy link

faddy19 commented Mar 27, 2024

The code to add support for Azure OpenAI to the Self-Operating Computer framework would depend on the specific implementation of the Azure OpenAI API. However, here is a general outline of the steps that would be involved:

Create a new model class: This class would be responsible for interacting with the Azure OpenAI API. It would need to have methods for sending requests and receiving responses.

Update the code that interacts with the API: The existing code that interacts with the OpenAI API would need to be updated to use the new model class. This would likely involve changes to the get_next_action() function and the operate() function.
Test your changes: Once you have made the changes, you would need to test them to ensure that they work as expected.
Here is a possible implementation of the new model class:

class AzureOpenAIModel:
def init(self, api_key):
self.api_key = api_key

def send_request(self, prompt):
    # Code to send a request to the Azure OpenAI API
    pass

def receive_response(self):
    # Code to receive a response from the Azure OpenAI API
    pass

Once you have created the new model class, you would need to update the get_next_action() function to use it. For example:

async def get_next_action(model, messages, objective, session_id):
if model == "azure-openai":
# Create an instance of the AzureOpenAIModel class
azure_openai_model = AzureOpenAIModel(api_key="YOUR_API_KEY")

    # Send a request to the Azure OpenAI API
    response = azure_openai_model.send_request(prompt="YOUR_PROMPT")

    # Receive a response from the Azure OpenAI API
    content = azure_openai_model.receive_response()

    # Process the response and return the next action
    return content, None

@faddy19
Copy link

faddy19 commented Mar 27, 2024

This should solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants