You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered: