Hey,
I know this is a double-up to a post in the feature request, but this might be best suited in the area of the forum. Hence the repost.
So I’m attempting to do the following:
Input some text and request chat GPT do to 2 things:
- Extract specific information from the input
- Suggest content for the information that was not extractable
Is there a way to do this reliably in one call?
As I imagine that this would quickly be done in one call. Requesting information extract, flagging on our side what has been completed, the requesting for generation of empty fields.
Once again, this, unfortunately, requires an additional request, which is more time and more $$$.
Example:
resp, err := c.openaiClient.CreateChatCompletion(
c.ctx,
openai.ChatCompletionRequest{
Model: "gpt-3.5-turbo-16k",
Messages: [{ Role: 'user', Content: 'My name is Alex, I am 42 years old'}],
Functions: []openai.FunctionDefinition{{
Name: "extract_info",
Description: "Extract info from text",
Parameters: json.RawMessage(`{
"properties": {
"name": {
"type": "string",
"description": "Character name"
},
"personality": {
"type": "string",
"description": "Character personality"
},
"generated_content": {
"type": "string",
"description": "AI Generated content",
"enum": ["name", "personality"]
},
},
"type": "object",
},
)
}`
)
I would expect the generated_content
to list the keys that have been AI-generated.
While we do it manually and this is touch and go it feels like this could be a great addition to the Functions API.
Unless there is another reliable way of achieving this?