Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
estheruary committed Nov 7, 2023
1 parent 1a2792a commit 34fb984
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ pip install kaginawa
```python
from kaginawa.client import Kaginawa

# You can also set the KAGI_API_KEY environment variable.
client = Kaginawa(token="YOUR_API_TOKEN")

response: KaginawaResponse = client.generate(
response: KaginawaFastGPTResponse = client.generate(
"Write a logstash pipeline file to send a heartbeat to a server "
"https://example.com/heartbeat every 30 seconds"
)
Expand All @@ -28,6 +29,32 @@ for reference in response.references:
print(reference.title)
print(reference.snippet)
print(reference.url)

response: KaginawaEnrichWebResponse = client.enrich_web(query="Best fermented hot sauce")

for result in response.results:
print(result.rank)
print(result.title)
print(result.url)
print(result.snippet)
print(result.published)


response: KaginawaSummarizationResponse = client.summarize(
url="https://example.com",
engine=KaginawaSummarizationEngine.AGNES,
summary_type=KaginawaSummaryType.TAKEAWAY,
target_language="FR"
)

print(response.output)

response: KaginawaSummarizationResponse = client.summarize(
text="The rain in Spain…",
engine=KaginawaSummarizationEngine.CECIL
)

print(response.output)
```

## FAQ
Expand Down

0 comments on commit 34fb984

Please sign in to comment.