Skip to content

Conversation

@jevinjiang
Copy link
Contributor

@jevinjiang jevinjiang commented Apr 18, 2024

Fixes #216

chatgpt connector doc

- `connectorName`, name of the connector.
- (required) `path`, path of the API.
- (required) `port`, port of the API.
- `idleTimeout`, idle TCP connection timeout in seconds. A connection will timeout and be closed if no data is received nor sent within the `idleTimeout` seconds. The default is 0, which means don't timeout.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value is 30 in your code. Why "The default is 0, which means don't timeout"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because, when I was writing the document, I downloaded the source code and the comment said "Zero means don't timeout" before I had time to modify the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is more appropriate to default to not timeout

- `connectorConfig`
- `connectorName`, name of the connector.
- (required) `path`, path of the API.
- (required) `port`, port of the API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you have added default values to these 2 items in your latest revision. Why "required"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, I don’t want users to use the default values ​​in the code, because I don’t know why there is no value in the yml. I prefer users to specify the configuration in the yml instead of using a black box. But your idea is also very good Logically speaking, since I didn't choose to throw an exception, it really shouldn't be "required"

- `parsePromptFileName`, parse prompt template required by the user to use the parse request, default to the "prompt" file in the resource folder.
- `openaiConfig`
- (required) `token`, token of the openai
- (required) `model`, model of the openai
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value is gpt-3.5-turbo in your code. Why "(required)"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as above

"fields": "gift:Was the item purchased as a gift for someone else? Answer True if yes, False if not or unknown;delivery_days:How many days did it take for the product to arrive? If this information is not found, output -1;price_value:Extract any sentences about the value or price, and output them as a comma separated Python list"
}'
```
if `datacontenttype` is `application/json`, `cloudevent.data` is:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the cloudevent.data that pops up here, please explain to the user what it is, e.g. it's "the key part of the results that Connector will get from ChatGPT", or some other better description of your own.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea~ , yours is better

"source": "/mycontext",
"subject":"test_topic",
"datacontenttype":"text/plain",
"text": "you want to talk to ChatGPT about "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to add "required" to the required fields here. The same applies to PARSE below.

@pandaapo
Copy link
Member

It may be better to create a new issue in this repo and link it to this PR.

@jevinjiang jevinjiang changed the title [ISSUE #4047] Support chatGPT source connector [ISSUE #216] Support chatGPT source connector Apr 22, 2024
@jevinjiang
Copy link
Contributor Author

It may be better to create a new issue in this repo and link it to this PR.

yep~

@Pil0tXia Pil0tXia merged commit f9c5d75 into apache:master Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc] Add ChatGPT connector doc

3 participants