Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enabling varargs for content filtering #55

Closed
wants to merge 7 commits into from

Conversation

KavithaSiva
Copy link
Contributor

@KavithaSiva KavithaSiva commented Aug 2, 2024

Proposal:

client.chatCompletion(
{
  deploymentConfiguration: { deploymentId: 'id' },
  llmConfig: {
    model_name: 'gpt-35-turbo-16k',
    model_params: { max_tokens: 50, temperature: 0.1 }
  },
  prompt: {
    template: [{ role: 'user', content: 'Hello' }]
  }
},
undefined,
{
  type: Module.Filtering,
  filterConfig: {
    input: { azureContentSafety: { Hate: 0, SelfHarm: 2 } },
    output: {
      azureContentSafety: { Sexual: 4, Violence: 6 }
    }
  }
})

Issues:

  • As the chatCompletion API already accepts an optional parameter (CustomRequestConfig), introducing varargs, forces us to either pass undefined or {} before we pass the actual module configuration as varargs which is awkward.
  • Alternate option would be always to have only two parameters to the function, first one being an explicit type containing deployment information, mandatory orchestration config and request configuration and the second parameter is the varargs for optional module configuration.
client.chatCompletion(
{
  deploymentConfiguration: { deploymentId: 'id' },
  llmConfig: {
    model_name: 'gpt-35-turbo-16k',
    model_params: { max_tokens: 50, temperature: 0.1 }
  },
  prompt: {
    template: [{ role: 'user', content: 'Hello' }]
  }
requestConfig: {//applicable properties}
},
{
  type: Module.Filtering,
  filterConfig: {
    input: { azureContentSafety: { Hate: 0, SelfHarm: 2 } },
    output: {
      azureContentSafety: { Sexual: 4, Violence: 6 }
    }
  }
})

@KavithaSiva KavithaSiva marked this pull request as draft August 2, 2024 16:14
@KavithaSiva KavithaSiva changed the title Feat/content filtering varargs feat: enabling varargs for content filtering Aug 2, 2024
@KavithaSiva
Copy link
Contributor Author

Closing this PR, as the proposal isn't very intuitive to use.

@KavithaSiva KavithaSiva closed this Aug 5, 2024
@KavithaSiva KavithaSiva deleted the feat/content-filtering-varargs branch August 6, 2024 14:06
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.

1 participant