Skip to content

Commit

Permalink
chore: fix the docs with new parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
Askir authored and jgpruitt committed Oct 24, 2024
1 parent 1ae162e commit 91bd90e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/anthropic.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ to run your AI queries:
, 'content', 'Name five famous people from Birmingham, Alabama.'
)
)
, _api_key=>$1
, api_key=>$1
) AS actual
\bind :anthropic_api_key
\g
Expand Down Expand Up @@ -129,7 +129,7 @@ to run your AI queries:
SELECT ai.anthropic_generate
( 'claude-3-5-sonnet-20240620'
, %s
, _api_key=>%s
, api_key=>%s
)
""", (Json(messages), ANTHROPIC_API_KEY))
records = cur.fetchall()
Expand Down
27 changes: 13 additions & 14 deletions docs/cohere.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ to run your AI queries:
SELECT ai.cohere_chat_complete
( 'command-r-plus'
, 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?'
, _seed=>42
, seed=>42
)->>'text'
;
```
Expand Down Expand Up @@ -73,8 +73,8 @@ to run your AI queries:
SELECT ai.cohere_chat_complete
( 'command-r-plus'
, 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?'
, _api_key=>$1
, _seed=>42
, api_key=>$1
, seed=>42
)->>'text'
\bind :cohere_api_key
\g
Expand Down Expand Up @@ -119,8 +119,8 @@ to run your AI queries:
SELECT ai.cohere_chat_complete
( 'command-r-plus'
, 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?'
, _api_key=>%s
, _seed=>42
, api_key=>%s
, seed=>42
)->>'text'
""", (COHERE_API_KEY, ))
records = cur.fetchall()
Expand Down Expand Up @@ -182,7 +182,7 @@ This section shows you how to use AI directly from your database using SQL.
```sql
select *
from ai.cohere_list_models(_endpoint=>'embed')
from ai.cohere_list_models(endpoint=>'embed')
;
```
Expand All @@ -205,7 +205,7 @@ This section shows you how to use AI directly from your database using SQL.
```sql
select *
from ai.cohere_list_models(_endpoint=>'generate', _default_only=>true);
from ai.cohere_list_models(endpoint=>'generate', default_only=>true);
```
Results
Expand Down Expand Up @@ -265,7 +265,7 @@ Embed content.
select ai.cohere_embed
( 'embed-english-light-v3.0'
, 'if a woodchuck could chuck wood, a woodchuck would chuck as much wood as he could'
, _input_type=>'search_document'
, input_type=>'search_document'
);
```
Expand Down Expand Up @@ -299,7 +299,7 @@ from jsonb_to_recordset
ai.cohere_classify
( 'embed-english-light-v3.0'
, array['bird', 'airplane', 'corn'] --inputs we want to classify
, _examples=>(select jsonb_agg(jsonb_build_object('text', examples.example, 'label', examples.label)) from examples)
, examples=>(select jsonb_agg(jsonb_build_object('text', examples.example, 'label', examples.label)) from examples)
)->'classifications'
) x(input text, prediction text, confidence float8)
;
Expand Down Expand Up @@ -335,7 +335,7 @@ select *
from ai.cohere_classify_simple
( 'embed-english-light-v3.0'
, array['bird', 'airplane', 'corn']
, _examples=>(select jsonb_agg(jsonb_build_object('text', examples.example, 'label', examples.label)) from examples)
, examples=>(select jsonb_agg(jsonb_build_object('text', examples.example, 'label', examples.label)) from examples)
) x
;
```
Expand Down Expand Up @@ -371,7 +371,7 @@ from jsonb_to_recordset
, 'What one programmer can do in one month, two programmers can do in two months.'
, 'how much wood would a woodchuck chuck if a woodchuck could chuck wood?'
)
, _return_documents=>true
, return_documents=>true
)->'results'
) x("index" int, "document" jsonb, relevance_score float8)
order by relevance_score desc
Expand Down Expand Up @@ -430,16 +430,15 @@ Complete chat prompts
select ai.cohere_chat_complete
( 'command-r-plus'
, 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?'
, _seed=>42
, seed=>42
)->>'text'
;
```
Results:
```text
According to a tongue-twister poem often attributed to Robert Hobart Davis and Richard Wayne Peck, a woodchuck (also known as a groundhog) would chuck, or throw, as much wood as a woodchuck would, if a woodchuck could chuck wood.
According to a tongue-twister poem often attributed to Robert Hobart Davis and Richard Wayne Peck, a woodchuck (also known as a groundhog) would chuck, or throw, "as much wood as a woodchuck would, if a woodchuck could chuck wood."
In a more serious biological context, woodchucks are known to be capable of causing significant damage to wood-based structures and landscapes due to their burrowing and chewing habits. They can chew through small trees and branches, although the exact amount of wood they could chuck or chew through would depend on various factors such as the size and age of the woodchuck, the type and condition of the wood, and the woodchuck's motivation and determination.
```

0 comments on commit 91bd90e

Please sign in to comment.