[IMP] html_editor, web_unsplash, website: AI Website Builder tweaks#258133
[IMP] html_editor, web_unsplash, website: AI Website Builder tweaks#258133Dj0ulo wants to merge 4 commits intoodoo:masterfrom
Conversation
1f1478a to
5cf3c86
Compare
40b7751 to
a291a42
Compare
In `ai_website`, we need to make an Unsplash request from inside an agent tool. However we can't call a controller method from a model. __Fix__ - Extract `_fetch_unsplash_images` into `ir.attachment` to make it callable from other models. - Make the `requests.get` call safer by adding a timeout, filtering the payload keys and putting the access key in `Authorization` header. - Replace the useless `request` variable uses with `self` - Add some constant for the Unsplash ICP keys
In some case, we need to use `defineWebsiteModels` without defining the mail models at the same time. For example, in `ai_website` we call `defineAIModels` which is defining the mail model `DiscussChannel` differently. __Fix__ A new parameter (i.e.`includeMailModels`) is added to be able to prevent the call to `defineMailModels` when needed.
*: web_unsplash __Before commit__ `_attachment_create` was a private method in the `HTML_Editor` controller that can only be called within a controller context as it uses the `request` variable. __After commit__ Make `attachment_create` a standalone function that can be imported and used from a model such as AI tools in `ai_website`.
a291a42 to
49529f7
Compare
In AI modules, the agent may take a long time to use the tools and generate content. We therefore need to increase the typing timeout to make the user understand that the AI is still working. This commit makes the typing timeout duration patchable in order to do that.
This one is safe: hard-coded URL set, timeout set.
This one is not ideal: the URL can be arbitrarily set by a portal users, through the route Indeed, it was already there before. We had a discussion to let the PR go through, and a change will be done / is planned to do something about that robodoo override=co/security |
|
@beledouxdenis you are not allowed to override 'co/security'. |
|
robodoo override=ci/security |
|
@robodoo r+ |
|
@Dj0ulo @pkyriakou because this PR has multiple commits, I need to know how to merge it:
|
|
@Dj0ulo @pkyriakou unable to stage: missing merge method |
|
@robodoo rebase-ff |
|
Merge method set to rebase and fast-forward. |
|
@robodoo retry |
In `ai_website`, we need to make an Unsplash request from inside an agent tool. However we can't call a controller method from a model. __Fix__ - Extract `_fetch_unsplash_images` into `ir.attachment` to make it callable from other models. - Make the `requests.get` call safer by adding a timeout, filtering the payload keys and putting the access key in `Authorization` header. - Replace the useless `request` variable uses with `self` - Add some constant for the Unsplash ICP keys Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In some case, we need to use `defineWebsiteModels` without defining the mail models at the same time. For example, in `ai_website` we call `defineAIModels` which is defining the mail model `DiscussChannel` differently. __Fix__ A new parameter (i.e.`includeMailModels`) is added to be able to prevent the call to `defineMailModels` when needed. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
*: web_unsplash __Before commit__ `_attachment_create` was a private method in the `HTML_Editor` controller that can only be called within a controller context as it uses the `request` variable. __After commit__ Make `attachment_create` a standalone function that can be imported and used from a model such as AI tools in `ai_website`. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In AI modules, the agent may take a long time to use the tools and generate content. We therefore need to increase the typing timeout to make the user understand that the AI is still working. This commit makes the typing timeout duration patchable in order to do that. closes #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In `ai_website`, we need to make an Unsplash request from inside an agent tool. However we can't call a controller method from a model. __Fix__ - Extract `_fetch_unsplash_images` into `ir.attachment` to make it callable from other models. - Make the `requests.get` call safer by adding a timeout, filtering the payload keys and putting the access key in `Authorization` header. - Replace the useless `request` variable uses with `self` - Add some constant for the Unsplash ICP keys Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In some case, we need to use `defineWebsiteModels` without defining the mail models at the same time. For example, in `ai_website` we call `defineAIModels` which is defining the mail model `DiscussChannel` differently. __Fix__ A new parameter (i.e.`includeMailModels`) is added to be able to prevent the call to `defineMailModels` when needed. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
*: web_unsplash __Before commit__ `_attachment_create` was a private method in the `HTML_Editor` controller that can only be called within a controller context as it uses the `request` variable. __After commit__ Make `attachment_create` a standalone function that can be imported and used from a model such as AI tools in `ai_website`. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In AI modules, the agent may take a long time to use the tools and generate content. We therefore need to increase the typing timeout to make the user understand that the AI is still working. This commit makes the typing timeout duration patchable in order to do that. closes #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In `ai_website`, we need to make an Unsplash request from inside an agent tool. However we can't call a controller method from a model. __Fix__ - Extract `_fetch_unsplash_images` into `ir.attachment` to make it callable from other models. - Make the `requests.get` call safer by adding a timeout, filtering the payload keys and putting the access key in `Authorization` header. - Replace the useless `request` variable uses with `self` - Add some constant for the Unsplash ICP keys Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In some case, we need to use `defineWebsiteModels` without defining the mail models at the same time. For example, in `ai_website` we call `defineAIModels` which is defining the mail model `DiscussChannel` differently. __Fix__ A new parameter (i.e.`includeMailModels`) is added to be able to prevent the call to `defineMailModels` when needed. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
*: web_unsplash __Before commit__ `_attachment_create` was a private method in the `HTML_Editor` controller that can only be called within a controller context as it uses the `request` variable. __After commit__ Make `attachment_create` a standalone function that can be imported and used from a model such as AI tools in `ai_website`. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In AI modules, the agent may take a long time to use the tools and generate content. We therefore need to increase the typing timeout to make the user understand that the AI is still working. This commit makes the typing timeout duration patchable in order to do that. closes #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In `ai_website`, we need to make an Unsplash request from inside an agent tool. However we can't call a controller method from a model. __Fix__ - Extract `_fetch_unsplash_images` into `ir.attachment` to make it callable from other models. - Make the `requests.get` call safer by adding a timeout, filtering the payload keys and putting the access key in `Authorization` header. - Replace the useless `request` variable uses with `self` - Add some constant for the Unsplash ICP keys Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In some case, we need to use `defineWebsiteModels` without defining the mail models at the same time. For example, in `ai_website` we call `defineAIModels` which is defining the mail model `DiscussChannel` differently. __Fix__ A new parameter (i.e.`includeMailModels`) is added to be able to prevent the call to `defineMailModels` when needed. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
*: web_unsplash __Before commit__ `_attachment_create` was a private method in the `HTML_Editor` controller that can only be called within a controller context as it uses the `request` variable. __After commit__ Make `attachment_create` a standalone function that can be imported and used from a model such as AI tools in `ai_website`. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In AI modules, the agent may take a long time to use the tools and generate content. We therefore need to increase the typing timeout to make the user understand that the AI is still working. This commit makes the typing timeout duration patchable in order to do that. closes #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In `ai_website`, we need to make an Unsplash request from inside an agent tool. However we can't call a controller method from a model. __Fix__ - Extract `_fetch_unsplash_images` into `ir.attachment` to make it callable from other models. - Make the `requests.get` call safer by adding a timeout, filtering the payload keys and putting the access key in `Authorization` header. - Replace the useless `request` variable uses with `self` - Add some constant for the Unsplash ICP keys Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In some case, we need to use `defineWebsiteModels` without defining the mail models at the same time. For example, in `ai_website` we call `defineAIModels` which is defining the mail model `DiscussChannel` differently. __Fix__ A new parameter (i.e.`includeMailModels`) is added to be able to prevent the call to `defineMailModels` when needed. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
*: web_unsplash __Before commit__ `_attachment_create` was a private method in the `HTML_Editor` controller that can only be called within a controller context as it uses the `request` variable. __After commit__ Make `attachment_create` a standalone function that can be imported and used from a model such as AI tools in `ai_website`. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In AI modules, the agent may take a long time to use the tools and generate content. We therefore need to increase the typing timeout to make the user understand that the AI is still working. This commit makes the typing timeout duration patchable in order to do that. closes #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
|
@Dj0ulo @pkyriakou linked pull request(s) odoo/enterprise#106196 not ready. Linked PRs are not staged until all of them are ready. |
In `ai_website`, we need to make an Unsplash request from inside an agent tool. However we can't call a controller method from a model. __Fix__ - Extract `_fetch_unsplash_images` into `ir.attachment` to make it callable from other models. - Make the `requests.get` call safer by adding a timeout, filtering the payload keys and putting the access key in `Authorization` header. - Replace the useless `request` variable uses with `self` - Add some constant for the Unsplash ICP keys Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In some case, we need to use `defineWebsiteModels` without defining the mail models at the same time. For example, in `ai_website` we call `defineAIModels` which is defining the mail model `DiscussChannel` differently. __Fix__ A new parameter (i.e.`includeMailModels`) is added to be able to prevent the call to `defineMailModels` when needed. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
*: web_unsplash __Before commit__ `_attachment_create` was a private method in the `HTML_Editor` controller that can only be called within a controller context as it uses the `request` variable. __After commit__ Make `attachment_create` a standalone function that can be imported and used from a model such as AI tools in `ai_website`. Part-of: #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>
In AI modules, the agent may take a long time to use the tools and generate content. We therefore need to increase the typing timeout to make the user understand that the AI is still working. This commit makes the typing timeout duration patchable in order to do that. closes #258133 Related: odoo/enterprise#106196 Signed-off-by: Panagiotis Kyriakou (paky) <paky@odoo.com>

Few tweaks for the AI Website Builder assistant enterprise PR: odoo/enterprise#106196
[IMP] web_unsplash: take Unsplash request out of the controller
In
ai_website, we need to make an Unsplash request from inside anagent tool. However we can't call a controller method from a model.
Fix
_fetch_unsplash_imagesintoir.attachmentto make itcallable from other models.
requests.getcall safer by adding a timeout, filtering thepayload keys and putting the access key in
Authorizationheader.requestvariable uses withself[IMP] website: make
defineMailModelsoptional indefineWebsiteModelsIn some case, we need to use
defineWebsiteModelswithout defining themail models at the same time.
For example, in
ai_websitewe calldefineAIModelswhich isdefining the mail model
DiscussChanneldifferently.Fix
A new parameter (i.e.
includeMailModels) is added to be able to preventthe call to
defineMailModelswhen needed.[IMP] html_editor, *: make
attachment_createusable in models*: web_unsplash
Before commit
_attachment_createwas a private method in theHTML_Editorcontroller that can only be called within a controller context as it
uses the
requestvariable.After commit
Make
attachment_createa standalone function that can be imported andused from a model such as AI tools in
ai_website.