Skip to content

Commit 475e0ab

Browse files
authored
feat: support vision for openai (#137)
* 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
1 parent 162a82f commit 475e0ab

File tree

5 files changed

+442
-104
lines changed

5 files changed

+442
-104
lines changed

agents/addon/extension/openai_chatgpt_python/manifest.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
},
4848
"max_memory_length": {
4949
"type": "int64"
50+
},
51+
"enable_tools": {
52+
"type": "bool"
5053
}
5154
},
5255
"data_in": [
@@ -78,6 +81,11 @@
7881
{
7982
"name": "flush"
8083
}
84+
],
85+
"image_frame_in": [
86+
{
87+
"name": "image_frame"
88+
}
8189
]
8290
}
83-
}
91+
}

agents/addon/extension/openai_chatgpt_python/openai_chatgpt.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __init__(self, config: OpenAIChatGPTConfig):
6565
self.session.proxies.update(proxies)
6666
self.client.session = self.session
6767

68-
def get_chat_completions_stream(self, messages):
68+
def get_chat_completions_stream(self, messages, tools = None):
6969
req = {
7070
"model": self.config.model,
7171
"messages": [
@@ -75,6 +75,7 @@ def get_chat_completions_stream(self, messages):
7575
},
7676
*messages,
7777
],
78+
"tools": tools,
7879
"temperature": self.config.temperature,
7980
"top_p": self.config.top_p,
8081
"presence_penalty": self.config.presence_penalty,

0 commit comments

Comments
 (0)