lib/ai21/client.rb in ai21-0.1.0 vs lib/ai21/client.rb in ai21-0.2.0
- old
+ new
@@ -30,19 +30,19 @@
def correct(prompt)
AI21::Client.post("/gec", {text: prompt})
end
- def improvements(prompt, types, options = {})
- AI21::Client.post("/improvements", {text: prompt, types: types}.merge(snake_to_camel(options)))
+ def improvements(prompt, types = ["fluency"])
+ AI21::Client.post("/improvements", {text: prompt, types: types})
end
- def summarize(prompt, source_type, options = {})
+ def summarize(prompt, source_type = "TEXT", options = {})
AI21::Client.post("/summarize", {source: prompt, sourceType: source_type}.merge(snake_to_camel(options)))
end
- def segmentation(prompt, source_type, options = {})
- AI21::Client.post("/segmentation", {source: prompt, sourceType: source_type}.merge(snake_to_camel(options)))
+ def segmentation(prompt, source_type = "TEXT")
+ AI21::Client.post("/segmentation", {source: prompt, sourceType: source_type})
end
def answer(question, context)
AI21::Client.post("/experimental/answer", {question: question, context: context})
end