Skip to content

Commit ed2249c

Browse files
committed
chore: local push
1 parent 80bc09e commit ed2249c

File tree

138 files changed

+1953
-880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+1953
-880
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# INFACTORY_API_KEY=
3+
INFACTORY_BASE_URL=https://i7y.dev/v1

.gitlab-ci.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.openapi-generator-ignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 115 additions & 242 deletions
Large diffs are not rendered by default.

examples.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""
2+
Here are some examples of the ways to use the Infactory API.
3+
"""
4+
5+
from infactory_client.client import InfactoryClient
6+
7+
8+
def create_api_for_user():
9+
nf = InfactoryClient()
10+
nf.login() # This should open a browser window to login via Clerk and return with the JWT token
11+
# optionally
12+
nf.connect() # This should connect to the Infactory API using the API Key to generate the JWT token
13+
14+
# The account creation should also run to create a default organization, team, user and project and set it to the state of the client
15+
state = nf.state
16+
print(state)
17+
18+
# The state serve as the default parameters for all requests
19+
20+
nf.upload("data/test.csv") # This should upload the file to the default project and create a dataline
21+
nf.explore(n=10) # This should generate 10 random questions and answers about the data - stored as query programs
22+
nf.query_programs.publish(all=True, public=True) # This should publish all query programs publicly
23+
print(nf.query_programs()) # This should list all query programs
24+
print(nf.project.docs.endpoint()) # This should return the project docs endpoint
25+
print(nf.project.docs.as_tools()) # Format the docs as tools to be used in a LLM chain
26+
27+
def ask_questions_of_a_dataset():
28+
nf = InfactoryClient()
29+
nf.login()
30+
# nf.connect()
31+
# Assuming a default project and datasource and query programs have been created
32+
# Select a query program from a list of query programs
33+
query_program = nf.query_programs()[0]
34+
print(query_program)
35+
36+
# Ask a question of the query program
37+
answer = nf.ask(query_program)
38+
print(answer)

git_push.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)