Skip to content

Commit

Permalink
feat: support vision for openai (#137)
Browse files Browse the repository at this point in the history
* feat: support vision for openai

* feat: add tool support

* updates

* feat: update property.json.example

* feat: finalize camera video feature

* feat: update propery.json.example

* feat: finalize camera change

* fix: avoice duplicate memory appending

* fix: adjust comments
  • Loading branch information
plutoless authored Aug 11, 2024
1 parent 162a82f commit 475e0ab
Show file tree
Hide file tree
Showing 5 changed files with 442 additions and 104 deletions.
10 changes: 9 additions & 1 deletion agents/addon/extension/openai_chatgpt_python/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
},
"max_memory_length": {
"type": "int64"
},
"enable_tools": {
"type": "bool"
}
},
"data_in": [
Expand Down Expand Up @@ -78,6 +81,11 @@
{
"name": "flush"
}
],
"image_frame_in": [
{
"name": "image_frame"
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, config: OpenAIChatGPTConfig):
self.session.proxies.update(proxies)
self.client.session = self.session

def get_chat_completions_stream(self, messages):
def get_chat_completions_stream(self, messages, tools = None):
req = {
"model": self.config.model,
"messages": [
Expand All @@ -75,6 +75,7 @@ def get_chat_completions_stream(self, messages):
},
*messages,
],
"tools": tools,
"temperature": self.config.temperature,
"top_p": self.config.top_p,
"presence_penalty": self.config.presence_penalty,
Expand Down
Loading

0 comments on commit 475e0ab

Please sign in to comment.